From b6c6217bf6f82883b81d31719d14770d561d6f76 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 15:06:20 -0700 Subject: [PATCH 01/15] Initial commit --- .gitignore | 37 ++++++ LICENSE | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 3 files changed, 412 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5148e52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5965407 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# total-reset.css +A CSS reset that goes all the way From ad501cb6c4169c9c0f7f9c80bb08f61c3b8995a6 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 15:06:20 -0700 Subject: [PATCH 02/15] Initial commit --- .gitignore | 37 ++++++ LICENSE | 373 +++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 + 3 files changed, 412 insertions(+) create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5148e52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Logs +logs +*.log +npm-debug.log* + +# Runtime data +pids +*.pid +*.seed + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (http://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules +jspm_packages + +# Optional npm cache directory +.npm + +# Optional REPL history +.node_repl_history diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5965407 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# total-reset.css +A CSS reset that goes all the way From 50503a421d6a3f0139b320fe179bd3a8aef59870 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 15:58:14 -0700 Subject: [PATCH 03/15] Migrate existing code to repo --- README.md | 92 ++++++- bower.json | 17 ++ dist/full-reset.css | 387 +++++++++++++++++++++++++++++ dist/full-reset.min.css | 1 + gulpfile.js | 38 +++ package.json | 26 ++ src/_accessibility.sass | 23 ++ src/_blocks.sass | 20 ++ src/_box-sizing.sass | 14 ++ src/_embedded-content.sass | 29 +++ src/_form-elements.sass | 159 ++++++++++++ src/_hidden.sass | 8 + src/_links.sass | 12 + src/_lists.sass | 7 + src/_responsive.sass | 13 + src/_tables.sass | 9 + src/_typography.sass | 85 +++++++ src/full-reset.sass | 19 ++ test/index.html | 493 +++++++++++++++++++++++++++++++++++++ 19 files changed, 1451 insertions(+), 1 deletion(-) create mode 100644 bower.json create mode 100644 dist/full-reset.css create mode 100644 dist/full-reset.min.css create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 src/_accessibility.sass create mode 100644 src/_blocks.sass create mode 100644 src/_box-sizing.sass create mode 100644 src/_embedded-content.sass create mode 100644 src/_form-elements.sass create mode 100644 src/_hidden.sass create mode 100644 src/_links.sass create mode 100644 src/_lists.sass create mode 100644 src/_responsive.sass create mode 100644 src/_tables.sass create mode 100644 src/_typography.sass create mode 100644 src/full-reset.sass create mode 100644 test/index.html diff --git a/README.md b/README.md index 5965407..d13f8ca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,92 @@ # total-reset.css -A CSS reset that goes all the way + +> A semantic CSS reset that goes all the way. + +total-reset.css takes the cross-browser fixes from the venerable normalize.css +but removes all of the opinionated base element styling, sets _all elements_ to +`display: block` and `box-sizing: border-box`, and generally tries to provide a +sane, unstyled default to every HTML element. + +*Note:* total-reset.css follows semantic versioning and as donated by the 0.x.y +version is still in active development, so please test it before deploying to a +production site! If you do find a bug or want to suggest an enchancement, please +file an [issue](https://github.com/mgeorgehansen/total-reset.css/issues). + +## Supported Browsers + +total-reset.css supports the latest 2 browser releases for the following major +browsers: + +* IE/Edge +* Firefox +* Chrome +* Safari + +## What Total Reset Does + +### Normalizes Styling and Fixes Bugs Across Different Browsers + +Many elements have slightly different default styles on different browsers, +and some browsers have subtle styling or user experience bugs. total-reset.css +tries to normalize those styles to a sane default and fix these bugs. Many of +these fixes are taken from [normalize.css](https://github.com/necolas/normalize.css/), +so full credit to [Nicolas Gallagher](https://github.com/necolas), +[Jonathan Neal](https://github.com/jonathantneal) and the other normalize.css +contributors. + +### Sets `box-sizing: border-box` on All Elements + +Border-box sizing is much more intuative to use than content-box in most cases +and encapsulates the padding and border in the element being styled, leading to +more modular components. + +total-reset.css uses Jon Neal's inherit-based [box-sizing reset method](https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + +### Sets `display: block` on All Elements + +Inline vs inline-block vs block display is a visual layout style that has +nothing to do with the semantic meaning of the markup, so it makes little sense +to have some elements display block and others display inline because those +elements might be styled differently in different contexts. + +Most elements are already block display and block display tends to have the +least-surprising layout behavior, so the default for all elements is set to +`display: block`. + +The only exception to this rule is checkboxes and radios since most browsers +don't allow changing the display of those elements. + +### Sets Inheritable Properties to `inherit` + +Many CSS properties, such as `font-size`, `text-align`, etc. are inhertiable, +meaning that if an element does not specify the value of the property (or +specifies a value of `inherit`) it will inherit the property value from its +closest ancenstor which explicitly sets the property value. + +total-reset.css tries support this property inheritance behavior where possible +and sets inheritable properties to `inherit` for elements that have explicit +values set by the browser. + +## Why Not Just Use normalize.css? + +normalize.css is great if you need a quick basis for your theme that you know is +reliable across different browers. But as your website or webapp grows you'll +quickly find that the global, opinionated base styles that normalize.css +provides get in the way of writing semantic, modular HTML. + +The major problem with default element styles is that it ties styling to +semantic meaning which makes reusing those styles in different contexts +difficult and encourages web developers to write unsemantic HTML. How many times +have you had to override `color`, `text-decoration` and hover states on a +wrapper ``? Or had a web developer use multiple `

` tags on a page because they had the largest `font-size`? These are all symptoms of tying your styling +to your semantics. + +## Credits + +* [Nicolas Gallagher](https://github.com/necolas), + [Jonathan Neal](https://github.com/jonathantneal) and all of the normalize.css + contributors for their amazing work on normalize.css which total-reset.css + borrows from heavily. +* [Chris Bracco](https://github.com/cbracco) for his excellent + [html5-test-page](https://github.com/cbracco/html5-test-page), which was used + to test all of the reset styles for total-reset.css. diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..bf213e2 --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "total-reset", + "version": "0.1.0", + "description": "A semantic CSS reset that goes all the way.", + "main": "dist/total-reset.css", + "authors": [ + "M. George Hansen " + ], + "license": "MPL-2.0", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/dist/full-reset.css b/dist/full-reset.css new file mode 100644 index 0000000..630f692 --- /dev/null +++ b/dist/full-reset.css @@ -0,0 +1,387 @@ +/** + * 1. Set all visible elements with default inline, inline-block and block to + * display as blocks. + * + * This might be controversial, but my position is that inline vs block + * display is a visual style and that block display is the most reasonable + * default for consistent styling. Rather than maintaining a mental map of + * which elements are _supposed_ to be inline vs block you can always rely + * on the fact that *all* elements are block by default. Except checkboxes + * and radios of course, because reasons. + */ +button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea { + display: block; } + +/** + * 1. Reset box-sizing on all elements to border-box. + * + * This uses Jon Neal's method of setting the default box-sizing on the root + * html element and then having all other elements inherit box-sizing + * (https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + * This method seems to cause the least number of headaches and override + * issues. + */ +html { + box-sizing: border-box; } + +*, *::before, *::after { + box-sizing: inherit; } + +/** + * 1. Fully reset link styling. + * 2. Remove gray background color from active links in IE 10 + * (from normalize.css). + */ +a { + color: inherit; + text-decoration: none; + background-color: transparent; } + a:link, a:active, a:visited { + color: inherit; } + +ul, ol { + margin: 0; + padding: 0; + list-style-type: none; } + ul ol, ul ul, ol ol, ol ul { + padding: 0; } + +/** + * 1. Prevent iOS and IE text size adjust after device orientation change + * without disabling user zoom. + */ +html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; } + +/** + * 1. Remove all styling from `h1-6` elements. + */ +h1, h2, h3, h4, h5, h6 { + margin: 0; + font-size: inherit; + font-weight: inherit; } + +/** + * 1. Remove extra margin around these elements. + */ +p, dl, dd, pre, figure, blockquote { + margin: 0; } + +/** + * 1. Ensure that these elements inherit font-style. + */ +i, cite, em, var, address, dfn { + font-style: inherit; } + +/** + * 1. Ensure that these elements inherit text-decoration. + */ +u, s, strike, del, ins { + text-decoration: inherit; } + +/** + * 1. Ensure that these elements inherit font-weight. + */ +dfn, strong, th, b { + font-weight: inherit; } + +small { + font-size: inherit; } + +/** + * 1. Ensure that font-family is inherited. + * 2. Inherit font size in IE. + */ +tt, code, kbd, samp, pre { + font-family: inherit; + font-size: inherit; } + +/** + * 1. Remove quotation marks. + */ +q::before, q::after { + content: ""; + content: none; } + +blockquote, q { + quotes: none; } + +/** + * 1. Reset styling for `mark` elements. + */ +mark { + background-color: inherit; + color: inherit; } + +hr { + box-sizing: content-box; + height: 0; } + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers + * (from normalize.css). + */ +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +/** + * 1. Remove border when inside `a` element in IE 9/10 (from normalize.css). + * + * Note: We don't use a parent `a` because it causes the selector to have + * high specificity and makes it difficult to override. `img` shouldn't + * have borders anyway, so no harm no foul. + */ +img { + border: none; } + +/** + * 1. Remove borders from iframes. This isn't 1995 any more. + */ +iframe { + border: none; } + +/** + * 1. Prevent modern browsers from displaying `audio` without controls. + * 2. Remove excess height in iOS 5 devices (from normalize.css). + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Correct overflow not hidden in IE 9/10/11 (from normalize.css). + */ +svg:not(:root) { + overflow: hidden; } + +/** + * 1. Remove the outline on focused elements that all major browers add. + * + * Ok, this is going to be *super* controversial but hear me out. Yes, + * accessability on focusable elements is really important and needs to be + * addressed in any design, but the default styling may not work for every + * design. For instance, a site with lots of grays would make the default + * focus outline difficult to see. Rather than try to guess what the best + * focus indicator should be for every design I argue that this is the + * responsibility of the designer to figure out. There is an argument to be + * made for standard and expected behavior, but it is easy enough to add + * a focus outline back in the application styling if that's what you want. + */ +:focus { + outline: none; } + +/** + * 1. Remove the underline that Firefox adds to elements with a title. + * + * Again, this might be controversal but see the comments on :focus above. + */ +[title] { + text-decoration: none; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +td, th { + padding: 0; } + +caption { + text-align: inherit; } + +html { + width: 100%; + overflow-x: hidden; } + +input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress { + width: 100%; } + +img, video, object, embed, iframe { + height: auto; + max-width: 100%; } + +audio { + max-width: 100%; } + +/** + * 1. Fully reset fieldsets removing all default styling. + */ +fieldset { + margin: 0; + padding: 0; + border: none; } + +/** + * 1. Fully reset lengends removing all default styling. + * 2. On Android Chrome browser lengends don't expand to 100%, so we fix that. + */ +legend { + border: 0; + padding: 0; + width: 100%; } + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +input:not([type="checkbox"]):not([type="radio"]), +optgroup, +select, +textarea, +button { + margin: 0; + padding: 0; + border: none; + background: none; + font: inherit; + color: inherit; } + +/** + * 1. Remove border-radius in Safari. + * 2. Remove glossy background in Safari. + * + * Note that this also removes the dropdown arrow in Safari, which isn't + * ideal but there is little we can do about it. + */ +select { + border-radius: 0; + -webkit-appearance: none; } + +/** + * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). + */ +textarea { + overflow: auto; } + +/** + * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). + */ +button { + overflow: visible; } + +/** + * 1. Address inconsistent `text-transform` inheritance for `button` and + * `select`. All other form control elements do not inherit `text-transform` + * values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and + * Opera. Correct `select` style inheritance in Firefox + * (from normalize.css). + */ +button, +select { + text-transform: none; } + +/** + * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"], +input[type="submit"], +input[type="reset"] { + -webkit-appearance: button; + cursor: pointer; + text-align: left; } + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; } + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; } + +/** + * Checkboxes and radio inputs are not styleable in most browsers unfortunately, + * so we have to treat them as a special case. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10 (from normalize.css). + * 2. Remove excess padding in IE 8/9/10 (from normalize.css). + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; } + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome which is + * unstylable (from normalize.css). + * 2. Remove inner padding and search cancel button in Safari and Chrome on + * OS X. Safari (but not Chrome) clips the cancel button when the search + * input has padding (and `textfield` appearance) (from normalize.css). + * + * Ideally we'd like to support the native cancel button, but unfortunately + * safar + * + */ +input[type="search"] { + -webkit-appearance: textfield; } + input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/** + * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and + * opacity (Firefox). + * + * Note: On Firefox number inputs do not respect placeholder styling. This is + * a known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1004130) with no + * workaround :(. + */ +::-webkit-input-placeholder { + color: inherit; } + +::-moz-placeholder { + opacity: inherit; } + +:-ms-input-placeholder { + color: inherit; } + +/** + * 1. Address `[hidden]` styling not present in IE 8/9/10 and hide the + * `template` element in IE 8/9/10/11, Safari, and Firefox < 22 + * (from normalize.css). + */ +[hidden], +template { + display: none; } + +/** + * 1. Remove default padding on body. + * 2. Normalize line-height. + */ +body { + margin: 0; + line-height: 1; } diff --git a/dist/full-reset.min.css b/dist/full-reset.min.css new file mode 100644 index 0000000..3de91fa --- /dev/null +++ b/dist/full-reset.min.css @@ -0,0 +1 @@ +b,dfn,h1,h2,h3,h4,h5,h6,strong,th{font-weight:inherit}h1,h2,h3,h4,h5,h6,small{font-size:inherit}[title],a{text-decoration:none}button,html,input:not([type=checkbox]):not([type=radio]),legend,meter,progress,select,textarea{width:100%}fieldset,iframe,img{border:none}a,a:active,a:link,a:visited,mark{color:inherit}button,datalist,fieldset,form,input:not([type=checkbox]):not([type=radio]),keygen,label,output,select,textarea{display:block}html{box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;overflow-x:hidden}*,::after,::before{box-sizing:inherit}a{background-color:transparent}ol,ul{margin:0;padding:0;list-style-type:none}ol ol,ol ul,td,th,ul ol,ul ul{padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,p,pre{margin:0}address,cite,dfn,em,i,var{font-style:inherit}del,ins,s,strike,u{text-decoration:inherit}code,kbd,pre,samp,tt{font-family:inherit;font-size:inherit}q::after,q::before{content:"";content:none}blockquote,q{quotes:none}mark{background-color:inherit}hr{box-sizing:content-box;height:0}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}:focus{outline:0}table{border-collapse:collapse;border-spacing:0}caption{text-align:inherit}embed,iframe,img,object,video{height:auto;max-width:100%}audio{max-width:100%}fieldset{margin:0;padding:0}legend{border:0;padding:0}button,input:not([type=checkbox]):not([type=radio]),optgroup,select,textarea{margin:0;padding:0;border:none;background:0 0;font:inherit;color:inherit}select{border-radius:0;-webkit-appearance:none}textarea{overflow:auto}button{overflow:visible}button,select{text-transform:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button,html input[type=button],input[type=submit],input[type=reset]{-webkit-appearance:button;cursor:pointer;text-align:left}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit}::-moz-placeholder{opacity:inherit}:-ms-input-placeholder{color:inherit}[hidden],template{display:none}body{margin:0;line-height:1} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..a19f54f --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,38 @@ +var gulp = require('gulp'); +var browserSync = require('browser-sync').create(); +var gulpMinifyCss = require('gulp-minify-css'); +var gulpSass = require('gulp-sass'); +var gulpRename = require('gulp-rename'); +var gulpIgnore = require('gulp-ignore'); + +var distDir = 'dist'; +var srcDir = 'src'; + +gulp.task('build', function() { + return gulp.src(srcDir + '/**/[^_]*.sass') + .pipe(gulpSass()).on('error', gulpSass.logError) + .pipe(gulp.dest(distDir)) + .pipe(browserSync.stream()) + .pipe(gulpMinifyCss()) + .pipe(gulpRename({ + extname: '.min.css' + })) + .pipe(gulp.dest(distDir)); +}); + +gulp.task('serve', ['build'], function() { + browserSync.init({ + server: { + baseDir: 'test', + routes: { + '/dist': 'dist' + }, + }, + open: false, + }); + + gulp.watch('test/**/*.html').on('change', browserSync.reload); + gulp.watch(srcDir + '/**/*.sass', ['build']); +}); + +gulp.task('default', ['build']) diff --git a/package.json b/package.json new file mode 100644 index 0000000..724eee2 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "total-reset", + "version": "0.1.0", + "description": "A semantic CSS reset that goes all the way.", + "keywords": [ + "css", + "reset" + ], + "main": "dist/total-reset.css", + "scripts": { + "prebuild": "npm install", + "build": "gulp build", + "serve": "npm run prebuild && gulp serve" + }, + "author": "M. George Hansen ", + "license": "MPL-2.0", + "devDependencies": { + "browser-sync": "^2.9.11", + "gulp": "^3.9.0", + "gulp-ignore": "^2.0.1", + "gulp-minify-css": "^1.2.1", + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.1.0", + "gulp-sourcemaps": "^1.6.0" + } +} diff --git a/src/_accessibility.sass b/src/_accessibility.sass new file mode 100644 index 0000000..b39c281 --- /dev/null +++ b/src/_accessibility.sass @@ -0,0 +1,23 @@ +/** + * 1. Remove the outline on focused elements that all major browers add. + * + * Ok, this is going to be *super* controversial but hear me out. Yes, + * accessability on focusable elements is really important and needs to be + * addressed in any design, but the default styling may not work for every + * design. For instance, a site with lots of grays would make the default + * focus outline difficult to see. Rather than try to guess what the best + * focus indicator should be for every design I argue that this is the + * responsibility of the designer to figure out. There is an argument to be + * made for standard and expected behavior, but it is easy enough to add + * a focus outline back in the application styling if that's what you want. + */ +:focus + outline: none /* 1 */ + +/** + * 1. Remove the underline that Firefox adds to elements with a title. + * + * Again, this might be controversal but see the comments on :focus above. + */ +[title] + text-decoration: none /* 1 */ diff --git a/src/_blocks.sass b/src/_blocks.sass new file mode 100644 index 0000000..9330469 --- /dev/null +++ b/src/_blocks.sass @@ -0,0 +1,20 @@ +/** + * 1. Set all visible elements with default inline, inline-block and block to + * display as blocks. + * + * This might be controversial, but my position is that inline vs block + * display is a visual style and that block display is the most reasonable + * default for consistent styling. Rather than maintaining a mental map of + * which elements are _supposed_ to be inline vs block you can always rely + * on the fact that *all* elements are block by default. Except checkboxes + * and radios of course, because reasons. + */ +article, aside, div, footer, header, hgroup, main, menu, nav, noscript, section, /* structural elements */ +abbr, acronym, blockquote, h1, h2, h3, h4, h5, h6, p, q, /* phrasing elements */ +b, bdo, em, i, ins, hr, mark, pre, s, small, strike, strong, sub, sup, u, wbr, /* typographic elements */ +a, address, cite, code, dd, dfn, dl, dt, figcaption, figure, kbd, ol, ul, samp, time, var, /* data markup elements */ +rp, rt, ruby, /* language elements */ +details, meter, progress, summary, /* interactive elements */ +audio, canvas, embed, img, svg, video, /* embedded content */ +button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea /* form elements */ + display: block /* 1 */ diff --git a/src/_box-sizing.sass b/src/_box-sizing.sass new file mode 100644 index 0000000..20dc26b --- /dev/null +++ b/src/_box-sizing.sass @@ -0,0 +1,14 @@ +/** + * 1. Reset box-sizing on all elements to border-box. + * + * This uses Jon Neal's method of setting the default box-sizing on the root + * html element and then having all other elements inherit box-sizing + * (https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + * This method seems to cause the least number of headaches and override + * issues. + */ +html + box-sizing: border-box /* 1 */ + +*, *::before, *::after + box-sizing: inherit /* 1 */ diff --git a/src/_embedded-content.sass b/src/_embedded-content.sass new file mode 100644 index 0000000..c7fbae5 --- /dev/null +++ b/src/_embedded-content.sass @@ -0,0 +1,29 @@ +/** + * 1. Remove border when inside `a` element in IE 9/10 (from normalize.css). + * + * Note: We don't use a parent `a` because it causes the selector to have + * high specificity and makes it difficult to override. `img` shouldn't + * have borders anyway, so no harm no foul. + */ +img + border: none + +/** + * 1. Remove borders from iframes. This isn't 1995 any more. + */ +iframe + border: none /* 1 */ + +/** + * 1. Prevent modern browsers from displaying `audio` without controls. + * 2. Remove excess height in iOS 5 devices (from normalize.css). + */ +audio:not([controls]) + display: none /* 1 */ + height: 0 /* 2 */ + +/** + * Correct overflow not hidden in IE 9/10/11 (from normalize.css). + */ +svg:not(:root) + overflow: hidden diff --git a/src/_form-elements.sass b/src/_form-elements.sass new file mode 100644 index 0000000..09d1ecd --- /dev/null +++ b/src/_form-elements.sass @@ -0,0 +1,159 @@ +/** + * 1. Fully reset fieldsets removing all default styling. + */ +fieldset + margin: 0 /* 1 */ + padding: 0 /* 1 */ + border: none /* 1 */ + +/** + * 1. Fully reset lengends removing all default styling. + * 2. On Android Chrome browser lengends don't expand to 100%, so we fix that. + */ +legend + border: 0 /* 1 */ + padding: 0 /* 1 */ + width: 100% /* 2 */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +input:not([type="checkbox"]):not([type="radio"]), +optgroup, +select, +textarea, +button + margin: 0 + padding: 0 + border: none + background: none + font: inherit + color: inherit + +/** + * 1. Remove border-radius in Safari. + * 2. Remove glossy background in Safari. + * + * Note that this also removes the dropdown arrow in Safari, which isn't + * ideal but there is little we can do about it. + */ +select + border-radius: 0 /* 1 */ + -webkit-appearance: none /* 2 */ + +/** + * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). + */ +textarea + overflow: auto + +/** + * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). + */ +button + overflow: visible /* 1 */ + +/** + * 1. Address inconsistent `text-transform` inheritance for `button` and + * `select`. All other form control elements do not inherit `text-transform` + * values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and + * Opera. Correct `select` style inheritance in Firefox + * (from normalize.css). + */ +button, +select + text-transform: none /* 1 */ + +/** + * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). + */ +button, +input + &::-moz-focus-inner + border: 0 /* 1 */ + padding: 0 /* 1 */ + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"] /* 1 */, +input[type="submit"], +input[type="reset"] + -webkit-appearance: button /* 2 */ + cursor: pointer /* 3 */ + text-align: left + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] + cursor: default + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input + line-height: normal + +/** + * Checkboxes and radio inputs are not styleable in most browsers unfortunately, + * so we have to treat them as a special case. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10 (from normalize.css). + * 2. Remove excess padding in IE 8/9/10 (from normalize.css). + */ +input[type="checkbox"], +input[type="radio"] + box-sizing: border-box /* 1 */ + padding: 0 /* 2 */ + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"] + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button + height: auto + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome which is + * unstylable (from normalize.css). + * 2. Remove inner padding and search cancel button in Safari and Chrome on + * OS X. Safari (but not Chrome) clips the cancel button when the search + * input has padding (and `textfield` appearance) (from normalize.css). + * + * Ideally we'd like to support the native cancel button, but unfortunately + * safar + * + */ +input[type="search"] + -webkit-appearance: textfield /* 1 */ + + &::-webkit-search-cancel-button, + &::-webkit-search-decoration + -webkit-appearance: none /* 2 */ + +/** + * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and + * opacity (Firefox). + * + * Note: On Firefox number inputs do not respect placeholder styling. This is + * a known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1004130) with no + * workaround :(. + */ +::-webkit-input-placeholder + color: inherit /* 1 */ +::-moz-placeholder + opacity: inherit /* 1 */ +:-ms-input-placeholder + color: inherit /* 1 */ diff --git a/src/_hidden.sass b/src/_hidden.sass new file mode 100644 index 0000000..302dcd3 --- /dev/null +++ b/src/_hidden.sass @@ -0,0 +1,8 @@ +/** + * 1. Address `[hidden]` styling not present in IE 8/9/10 and hide the + * `template` element in IE 8/9/10/11, Safari, and Firefox < 22 + * (from normalize.css). + */ +[hidden], +template + display: none /* 1 */ diff --git a/src/_links.sass b/src/_links.sass new file mode 100644 index 0000000..f79de86 --- /dev/null +++ b/src/_links.sass @@ -0,0 +1,12 @@ +/** + * 1. Fully reset link styling. + * 2. Remove gray background color from active links in IE 10 + * (from normalize.css). + */ +a + color: inherit /* 1 */ + text-decoration: none /* 1 */ + background-color: transparent /* 2 */ + + &:link, &:active, &:visited + color: inherit /* 1 */ diff --git a/src/_lists.sass b/src/_lists.sass new file mode 100644 index 0000000..49199d8 --- /dev/null +++ b/src/_lists.sass @@ -0,0 +1,7 @@ +ul, ol + margin: 0 + padding: 0 + list-style-type: none + + ol, ul + padding: 0 diff --git a/src/_responsive.sass b/src/_responsive.sass new file mode 100644 index 0000000..333b1dd --- /dev/null +++ b/src/_responsive.sass @@ -0,0 +1,13 @@ +html + width: 100% + overflow-x: hidden + +input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress + width: 100% + +img, video, object, embed, iframe + height: auto + max-width: 100% + +audio + max-width: 100% diff --git a/src/_tables.sass b/src/_tables.sass new file mode 100644 index 0000000..9e9134c --- /dev/null +++ b/src/_tables.sass @@ -0,0 +1,9 @@ +table + border-collapse: collapse + border-spacing: 0 + +td, th + padding: 0 + +caption + text-align: inherit diff --git a/src/_typography.sass b/src/_typography.sass new file mode 100644 index 0000000..a4dc81b --- /dev/null +++ b/src/_typography.sass @@ -0,0 +1,85 @@ +/** + * 1. Prevent iOS and IE text size adjust after device orientation change + * without disabling user zoom. + */ +html + -ms-text-size-adjust: 100% /* 1 */ + -webkit-text-size-adjust: 100% /* 1 */ + +/** + * 1. Remove all styling from `h1-6` elements. + */ +h1, h2, h3, h4, h5, h6 + margin: 0 /* 1 */ + font-size: inherit /* 1 */ + font-weight: inherit /* 1 */ + +/** + * 1. Remove extra margin around these elements. + */ +p, dl, dd, pre, figure, blockquote + margin: 0 /* 1 */ + +/** + * 1. Ensure that these elements inherit font-style. + */ +i, cite, em, var, address, dfn + font-style: inherit /* 1 */ + +/** + * 1. Ensure that these elements inherit text-decoration. + */ +u, s, strike, del, ins + text-decoration: inherit /* 1 */ + +/** + * 1. Ensure that these elements inherit font-weight. + */ +dfn, strong, th, b + font-weight: inherit /* 1 */ + +small + font-size: inherit + +/** + * 1. Ensure that font-family is inherited. + * 2. Inherit font size in IE. + */ +tt, code, kbd, samp, pre + font-family: inherit /* 1 */ + font-size: inherit /* 2 */ + +/** + * 1. Remove quotation marks. + */ +q + &::before, &::after + content: '' /* 1 */ + content: none /* 1 */ +blockquote, q + quotes: none /* 1 */ + +/** + * 1. Reset styling for `mark` elements. + */ +mark + background-color: inherit /* 1 */ + color: inherit /* 1 */ + +hr + box-sizing: content-box /* 1 */ + height: 0 /* 1 */ + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers + * (from normalize.css). + */ +sub, sup + font-size: 75% + line-height: 0 + position: relative + vertical-align: baseline +sup + top: -0.5em +sub + bottom: -0.25em diff --git a/src/full-reset.sass b/src/full-reset.sass new file mode 100644 index 0000000..df81438 --- /dev/null +++ b/src/full-reset.sass @@ -0,0 +1,19 @@ +@import blocks +@import box-sizing +@import links +@import lists +@import typography +@import embedded-content +@import accessibility +@import tables +@import responsive +@import form-elements +@import hidden + +/** + * 1. Remove default padding on body. + * 2. Normalize line-height. + */ +body + margin: 0 /* 1 */ + line-height: 1 /* 2 */ diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..92b05b7 --- /dev/null +++ b/test/index.html @@ -0,0 +1,493 @@ + + + + + + HTML5 Test Page + + + + +
+
+

HTML5 Test Page

+

This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.

+
+ +
+ +
+
+

Text

+ +
+
+

Headings

+
+ +
+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+
+ + +
+ +
+

Paragraphs

+ +
+

A paragraph (from the Greek paragraphos, “to write beside” or “written beside”) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.

+
+ + +
+ +
+

Blockquotes

+ +
+
+

A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.

+

It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.

+ Said no one, ever. +
+
+ + +
+ +
+

Lists

+ +
+

Definition list

+
+
Definition List Title
+
This is a definition list division.
+
+ +

Ordered List

+
    +
  1. List Item 1
  2. +
  3. List Item 2
  4. +
  5. List Item 3
  6. +
+ +

Unordered List

+
    +
  • List Item 1
  • +
  • List Item 2
  • +
  • List Item 3
  • +
+
+ + +
+ +
+

Horizontal rules

+ +
+
+
+ + +
+ +
+

Tabular data

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table Caption
Table Heading 1Table Heading 2Table Heading 3Table Heading 4Table Heading 5
Table Footer 1Table Footer 2Table Footer 3Table Footer 4Table Footer 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
+ + +
+ +
+

Code

+ +
+

Keyboard input: Cmd

+

Inline code: <div>code</div>

+

Sample output: This is sample output from a computer program.

+ +

Pre-formatted text

+ +
P R E F O R M A T T E D T E X T
+! " # $ % & ' ( ) * + , - . /
+0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+@ A B C D E F G H I J K L M N O
+P Q R S T U V W X Y Z [ \ ] ^ _
+` a b c d e f g h i j k l m n o
+p q r s t u v w x y z { | } ~ 
+
+ + +
+ +
+

Inline elements

+ +
+

This is a text link.

+ +

Strong is used to indicate strong importance.

+ +

This text has added emphasis.

+ +

The b element is stylistically different text from normal text, without any special importance.

+ +

The i element is text that is offset from the normal text.

+ +

The u element is text with an unarticulated, though explicitly rendered, non-textual annotation.

+ +

This text is deleted and This text is inserted.

+ +

This text has a strikethrough.

+ +

Superscript®.

+ +

Subscript for things like H2O.

+ +

This small text is small for for fine print, etc.

+ +

Abbreviation: HTML

+ +

This text is a short inline quotation.

+ +

This is a citation. + +

The dfn element indicates a definition.

+ +

The mark element indicates a highlight.

+ +

The variable element, such as x = y.

+ +

The time element:

+
+ + +
+
+ +
+

Embedded content

+ +
+

Images

+
+

No <figure> element

+

Image alt text

+

Linked image

+ Image alt text +

Wrapped in a <figure> element, no <figcaption>

+
Image alt text
+

Wrapped in a <figure> element, with a <figcaption>

+
+ Image alt text +
Here is a caption for this image.
+
+
+ +
+ +
+

Audio

+
+ +
+ +
+

Video

+
+ +
+ +
+

Canvas

+
canvas
+ +
+ +
+

Meter

+
2 out of 10
+ +
+ +
+

Progress

+
progress
+ +
+ +
+

Inline SVG

+
+ +
+ + +
+ +
+

Form elements

+ +
+
+ Input fields + +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+ +

[Top]

+ +
+ Select menus + +

+ + +

+
+ +

[Top]

+ +
+ Checkboxes + +
    +
  • +
  • +
  • +
+
+ +

[Top]

+ +
+ Radio buttons + +
    +
  • +
  • +
  • +
+
+ +

[Top]

+ +
+ Textareas + +

+ + +

+
+ +

[Top]

+ +
+ HTML5 inputs + +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+ +

[Top]

+ +
+ Action buttons + +

+ + + + +

+
+ +

[Top]

+
+
+
+ + +
+ + From 09aaefdc13b90dbcf1f22f23662b6ecc2d86058d Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 15:58:14 -0700 Subject: [PATCH 04/15] Migrate existing code to repo --- README.md | 92 ++++++- bower.json | 17 ++ dist/full-reset.css | 387 +++++++++++++++++++++++++++++ dist/full-reset.min.css | 1 + gulpfile.js | 38 +++ package.json | 26 ++ src/_accessibility.sass | 23 ++ src/_blocks.sass | 20 ++ src/_box-sizing.sass | 14 ++ src/_embedded-content.sass | 29 +++ src/_form-elements.sass | 159 ++++++++++++ src/_hidden.sass | 8 + src/_links.sass | 12 + src/_lists.sass | 7 + src/_responsive.sass | 13 + src/_tables.sass | 9 + src/_typography.sass | 85 +++++++ src/full-reset.sass | 19 ++ test/index.html | 493 +++++++++++++++++++++++++++++++++++++ 19 files changed, 1451 insertions(+), 1 deletion(-) create mode 100644 bower.json create mode 100644 dist/full-reset.css create mode 100644 dist/full-reset.min.css create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 src/_accessibility.sass create mode 100644 src/_blocks.sass create mode 100644 src/_box-sizing.sass create mode 100644 src/_embedded-content.sass create mode 100644 src/_form-elements.sass create mode 100644 src/_hidden.sass create mode 100644 src/_links.sass create mode 100644 src/_lists.sass create mode 100644 src/_responsive.sass create mode 100644 src/_tables.sass create mode 100644 src/_typography.sass create mode 100644 src/full-reset.sass create mode 100644 test/index.html diff --git a/README.md b/README.md index 5965407..d13f8ca 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,92 @@ # total-reset.css -A CSS reset that goes all the way + +> A semantic CSS reset that goes all the way. + +total-reset.css takes the cross-browser fixes from the venerable normalize.css +but removes all of the opinionated base element styling, sets _all elements_ to +`display: block` and `box-sizing: border-box`, and generally tries to provide a +sane, unstyled default to every HTML element. + +*Note:* total-reset.css follows semantic versioning and as donated by the 0.x.y +version is still in active development, so please test it before deploying to a +production site! If you do find a bug or want to suggest an enchancement, please +file an [issue](https://github.com/mgeorgehansen/total-reset.css/issues). + +## Supported Browsers + +total-reset.css supports the latest 2 browser releases for the following major +browsers: + +* IE/Edge +* Firefox +* Chrome +* Safari + +## What Total Reset Does + +### Normalizes Styling and Fixes Bugs Across Different Browsers + +Many elements have slightly different default styles on different browsers, +and some browsers have subtle styling or user experience bugs. total-reset.css +tries to normalize those styles to a sane default and fix these bugs. Many of +these fixes are taken from [normalize.css](https://github.com/necolas/normalize.css/), +so full credit to [Nicolas Gallagher](https://github.com/necolas), +[Jonathan Neal](https://github.com/jonathantneal) and the other normalize.css +contributors. + +### Sets `box-sizing: border-box` on All Elements + +Border-box sizing is much more intuative to use than content-box in most cases +and encapsulates the padding and border in the element being styled, leading to +more modular components. + +total-reset.css uses Jon Neal's inherit-based [box-sizing reset method](https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + +### Sets `display: block` on All Elements + +Inline vs inline-block vs block display is a visual layout style that has +nothing to do with the semantic meaning of the markup, so it makes little sense +to have some elements display block and others display inline because those +elements might be styled differently in different contexts. + +Most elements are already block display and block display tends to have the +least-surprising layout behavior, so the default for all elements is set to +`display: block`. + +The only exception to this rule is checkboxes and radios since most browsers +don't allow changing the display of those elements. + +### Sets Inheritable Properties to `inherit` + +Many CSS properties, such as `font-size`, `text-align`, etc. are inhertiable, +meaning that if an element does not specify the value of the property (or +specifies a value of `inherit`) it will inherit the property value from its +closest ancenstor which explicitly sets the property value. + +total-reset.css tries support this property inheritance behavior where possible +and sets inheritable properties to `inherit` for elements that have explicit +values set by the browser. + +## Why Not Just Use normalize.css? + +normalize.css is great if you need a quick basis for your theme that you know is +reliable across different browers. But as your website or webapp grows you'll +quickly find that the global, opinionated base styles that normalize.css +provides get in the way of writing semantic, modular HTML. + +The major problem with default element styles is that it ties styling to +semantic meaning which makes reusing those styles in different contexts +difficult and encourages web developers to write unsemantic HTML. How many times +have you had to override `color`, `text-decoration` and hover states on a +wrapper ``? Or had a web developer use multiple `

` tags on a page because they had the largest `font-size`? These are all symptoms of tying your styling +to your semantics. + +## Credits + +* [Nicolas Gallagher](https://github.com/necolas), + [Jonathan Neal](https://github.com/jonathantneal) and all of the normalize.css + contributors for their amazing work on normalize.css which total-reset.css + borrows from heavily. +* [Chris Bracco](https://github.com/cbracco) for his excellent + [html5-test-page](https://github.com/cbracco/html5-test-page), which was used + to test all of the reset styles for total-reset.css. diff --git a/bower.json b/bower.json new file mode 100644 index 0000000..bf213e2 --- /dev/null +++ b/bower.json @@ -0,0 +1,17 @@ +{ + "name": "total-reset", + "version": "0.1.0", + "description": "A semantic CSS reset that goes all the way.", + "main": "dist/total-reset.css", + "authors": [ + "M. George Hansen " + ], + "license": "MPL-2.0", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "tests" + ] +} diff --git a/dist/full-reset.css b/dist/full-reset.css new file mode 100644 index 0000000..630f692 --- /dev/null +++ b/dist/full-reset.css @@ -0,0 +1,387 @@ +/** + * 1. Set all visible elements with default inline, inline-block and block to + * display as blocks. + * + * This might be controversial, but my position is that inline vs block + * display is a visual style and that block display is the most reasonable + * default for consistent styling. Rather than maintaining a mental map of + * which elements are _supposed_ to be inline vs block you can always rely + * on the fact that *all* elements are block by default. Except checkboxes + * and radios of course, because reasons. + */ +button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea { + display: block; } + +/** + * 1. Reset box-sizing on all elements to border-box. + * + * This uses Jon Neal's method of setting the default box-sizing on the root + * html element and then having all other elements inherit box-sizing + * (https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + * This method seems to cause the least number of headaches and override + * issues. + */ +html { + box-sizing: border-box; } + +*, *::before, *::after { + box-sizing: inherit; } + +/** + * 1. Fully reset link styling. + * 2. Remove gray background color from active links in IE 10 + * (from normalize.css). + */ +a { + color: inherit; + text-decoration: none; + background-color: transparent; } + a:link, a:active, a:visited { + color: inherit; } + +ul, ol { + margin: 0; + padding: 0; + list-style-type: none; } + ul ol, ul ul, ol ol, ol ul { + padding: 0; } + +/** + * 1. Prevent iOS and IE text size adjust after device orientation change + * without disabling user zoom. + */ +html { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; } + +/** + * 1. Remove all styling from `h1-6` elements. + */ +h1, h2, h3, h4, h5, h6 { + margin: 0; + font-size: inherit; + font-weight: inherit; } + +/** + * 1. Remove extra margin around these elements. + */ +p, dl, dd, pre, figure, blockquote { + margin: 0; } + +/** + * 1. Ensure that these elements inherit font-style. + */ +i, cite, em, var, address, dfn { + font-style: inherit; } + +/** + * 1. Ensure that these elements inherit text-decoration. + */ +u, s, strike, del, ins { + text-decoration: inherit; } + +/** + * 1. Ensure that these elements inherit font-weight. + */ +dfn, strong, th, b { + font-weight: inherit; } + +small { + font-size: inherit; } + +/** + * 1. Ensure that font-family is inherited. + * 2. Inherit font size in IE. + */ +tt, code, kbd, samp, pre { + font-family: inherit; + font-size: inherit; } + +/** + * 1. Remove quotation marks. + */ +q::before, q::after { + content: ""; + content: none; } + +blockquote, q { + quotes: none; } + +/** + * 1. Reset styling for `mark` elements. + */ +mark { + background-color: inherit; + color: inherit; } + +hr { + box-sizing: content-box; + height: 0; } + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers + * (from normalize.css). + */ +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; } + +sup { + top: -0.5em; } + +sub { + bottom: -0.25em; } + +/** + * 1. Remove border when inside `a` element in IE 9/10 (from normalize.css). + * + * Note: We don't use a parent `a` because it causes the selector to have + * high specificity and makes it difficult to override. `img` shouldn't + * have borders anyway, so no harm no foul. + */ +img { + border: none; } + +/** + * 1. Remove borders from iframes. This isn't 1995 any more. + */ +iframe { + border: none; } + +/** + * 1. Prevent modern browsers from displaying `audio` without controls. + * 2. Remove excess height in iOS 5 devices (from normalize.css). + */ +audio:not([controls]) { + display: none; + height: 0; } + +/** + * Correct overflow not hidden in IE 9/10/11 (from normalize.css). + */ +svg:not(:root) { + overflow: hidden; } + +/** + * 1. Remove the outline on focused elements that all major browers add. + * + * Ok, this is going to be *super* controversial but hear me out. Yes, + * accessability on focusable elements is really important and needs to be + * addressed in any design, but the default styling may not work for every + * design. For instance, a site with lots of grays would make the default + * focus outline difficult to see. Rather than try to guess what the best + * focus indicator should be for every design I argue that this is the + * responsibility of the designer to figure out. There is an argument to be + * made for standard and expected behavior, but it is easy enough to add + * a focus outline back in the application styling if that's what you want. + */ +:focus { + outline: none; } + +/** + * 1. Remove the underline that Firefox adds to elements with a title. + * + * Again, this might be controversal but see the comments on :focus above. + */ +[title] { + text-decoration: none; } + +table { + border-collapse: collapse; + border-spacing: 0; } + +td, th { + padding: 0; } + +caption { + text-align: inherit; } + +html { + width: 100%; + overflow-x: hidden; } + +input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress { + width: 100%; } + +img, video, object, embed, iframe { + height: auto; + max-width: 100%; } + +audio { + max-width: 100%; } + +/** + * 1. Fully reset fieldsets removing all default styling. + */ +fieldset { + margin: 0; + padding: 0; + border: none; } + +/** + * 1. Fully reset lengends removing all default styling. + * 2. On Android Chrome browser lengends don't expand to 100%, so we fix that. + */ +legend { + border: 0; + padding: 0; + width: 100%; } + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +input:not([type="checkbox"]):not([type="radio"]), +optgroup, +select, +textarea, +button { + margin: 0; + padding: 0; + border: none; + background: none; + font: inherit; + color: inherit; } + +/** + * 1. Remove border-radius in Safari. + * 2. Remove glossy background in Safari. + * + * Note that this also removes the dropdown arrow in Safari, which isn't + * ideal but there is little we can do about it. + */ +select { + border-radius: 0; + -webkit-appearance: none; } + +/** + * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). + */ +textarea { + overflow: auto; } + +/** + * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). + */ +button { + overflow: visible; } + +/** + * 1. Address inconsistent `text-transform` inheritance for `button` and + * `select`. All other form control elements do not inherit `text-transform` + * values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and + * Opera. Correct `select` style inheritance in Firefox + * (from normalize.css). + */ +button, +select { + text-transform: none; } + +/** + * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). + */ +button::-moz-focus-inner, +input::-moz-focus-inner { + border: 0; + padding: 0; } + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"], +input[type="submit"], +input[type="reset"] { + -webkit-appearance: button; + cursor: pointer; + text-align: left; } + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] { + cursor: default; } + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input { + line-height: normal; } + +/** + * Checkboxes and radio inputs are not styleable in most browsers unfortunately, + * so we have to treat them as a special case. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10 (from normalize.css). + * 2. Remove excess padding in IE 8/9/10 (from normalize.css). + */ +input[type="checkbox"], +input[type="radio"] { + box-sizing: border-box; + padding: 0; } + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { + height: auto; } + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome which is + * unstylable (from normalize.css). + * 2. Remove inner padding and search cancel button in Safari and Chrome on + * OS X. Safari (but not Chrome) clips the cancel button when the search + * input has padding (and `textfield` appearance) (from normalize.css). + * + * Ideally we'd like to support the native cancel button, but unfortunately + * safar + * + */ +input[type="search"] { + -webkit-appearance: textfield; } + input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; } + +/** + * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and + * opacity (Firefox). + * + * Note: On Firefox number inputs do not respect placeholder styling. This is + * a known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1004130) with no + * workaround :(. + */ +::-webkit-input-placeholder { + color: inherit; } + +::-moz-placeholder { + opacity: inherit; } + +:-ms-input-placeholder { + color: inherit; } + +/** + * 1. Address `[hidden]` styling not present in IE 8/9/10 and hide the + * `template` element in IE 8/9/10/11, Safari, and Firefox < 22 + * (from normalize.css). + */ +[hidden], +template { + display: none; } + +/** + * 1. Remove default padding on body. + * 2. Normalize line-height. + */ +body { + margin: 0; + line-height: 1; } diff --git a/dist/full-reset.min.css b/dist/full-reset.min.css new file mode 100644 index 0000000..3de91fa --- /dev/null +++ b/dist/full-reset.min.css @@ -0,0 +1 @@ +b,dfn,h1,h2,h3,h4,h5,h6,strong,th{font-weight:inherit}h1,h2,h3,h4,h5,h6,small{font-size:inherit}[title],a{text-decoration:none}button,html,input:not([type=checkbox]):not([type=radio]),legend,meter,progress,select,textarea{width:100%}fieldset,iframe,img{border:none}a,a:active,a:link,a:visited,mark{color:inherit}button,datalist,fieldset,form,input:not([type=checkbox]):not([type=radio]),keygen,label,output,select,textarea{display:block}html{box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;overflow-x:hidden}*,::after,::before{box-sizing:inherit}a{background-color:transparent}ol,ul{margin:0;padding:0;list-style-type:none}ol ol,ol ul,td,th,ul ol,ul ul{padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,p,pre{margin:0}address,cite,dfn,em,i,var{font-style:inherit}del,ins,s,strike,u{text-decoration:inherit}code,kbd,pre,samp,tt{font-family:inherit;font-size:inherit}q::after,q::before{content:"";content:none}blockquote,q{quotes:none}mark{background-color:inherit}hr{box-sizing:content-box;height:0}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}:focus{outline:0}table{border-collapse:collapse;border-spacing:0}caption{text-align:inherit}embed,iframe,img,object,video{height:auto;max-width:100%}audio{max-width:100%}fieldset{margin:0;padding:0}legend{border:0;padding:0}button,input:not([type=checkbox]):not([type=radio]),optgroup,select,textarea{margin:0;padding:0;border:none;background:0 0;font:inherit;color:inherit}select{border-radius:0;-webkit-appearance:none}textarea{overflow:auto}button{overflow:visible}button,select{text-transform:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button,html input[type=button],input[type=submit],input[type=reset]{-webkit-appearance:button;cursor:pointer;text-align:left}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit}::-moz-placeholder{opacity:inherit}:-ms-input-placeholder{color:inherit}[hidden],template{display:none}body{margin:0;line-height:1} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..a19f54f --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,38 @@ +var gulp = require('gulp'); +var browserSync = require('browser-sync').create(); +var gulpMinifyCss = require('gulp-minify-css'); +var gulpSass = require('gulp-sass'); +var gulpRename = require('gulp-rename'); +var gulpIgnore = require('gulp-ignore'); + +var distDir = 'dist'; +var srcDir = 'src'; + +gulp.task('build', function() { + return gulp.src(srcDir + '/**/[^_]*.sass') + .pipe(gulpSass()).on('error', gulpSass.logError) + .pipe(gulp.dest(distDir)) + .pipe(browserSync.stream()) + .pipe(gulpMinifyCss()) + .pipe(gulpRename({ + extname: '.min.css' + })) + .pipe(gulp.dest(distDir)); +}); + +gulp.task('serve', ['build'], function() { + browserSync.init({ + server: { + baseDir: 'test', + routes: { + '/dist': 'dist' + }, + }, + open: false, + }); + + gulp.watch('test/**/*.html').on('change', browserSync.reload); + gulp.watch(srcDir + '/**/*.sass', ['build']); +}); + +gulp.task('default', ['build']) diff --git a/package.json b/package.json new file mode 100644 index 0000000..724eee2 --- /dev/null +++ b/package.json @@ -0,0 +1,26 @@ +{ + "name": "total-reset", + "version": "0.1.0", + "description": "A semantic CSS reset that goes all the way.", + "keywords": [ + "css", + "reset" + ], + "main": "dist/total-reset.css", + "scripts": { + "prebuild": "npm install", + "build": "gulp build", + "serve": "npm run prebuild && gulp serve" + }, + "author": "M. George Hansen ", + "license": "MPL-2.0", + "devDependencies": { + "browser-sync": "^2.9.11", + "gulp": "^3.9.0", + "gulp-ignore": "^2.0.1", + "gulp-minify-css": "^1.2.1", + "gulp-rename": "^1.2.2", + "gulp-sass": "^2.1.0", + "gulp-sourcemaps": "^1.6.0" + } +} diff --git a/src/_accessibility.sass b/src/_accessibility.sass new file mode 100644 index 0000000..b39c281 --- /dev/null +++ b/src/_accessibility.sass @@ -0,0 +1,23 @@ +/** + * 1. Remove the outline on focused elements that all major browers add. + * + * Ok, this is going to be *super* controversial but hear me out. Yes, + * accessability on focusable elements is really important and needs to be + * addressed in any design, but the default styling may not work for every + * design. For instance, a site with lots of grays would make the default + * focus outline difficult to see. Rather than try to guess what the best + * focus indicator should be for every design I argue that this is the + * responsibility of the designer to figure out. There is an argument to be + * made for standard and expected behavior, but it is easy enough to add + * a focus outline back in the application styling if that's what you want. + */ +:focus + outline: none /* 1 */ + +/** + * 1. Remove the underline that Firefox adds to elements with a title. + * + * Again, this might be controversal but see the comments on :focus above. + */ +[title] + text-decoration: none /* 1 */ diff --git a/src/_blocks.sass b/src/_blocks.sass new file mode 100644 index 0000000..9330469 --- /dev/null +++ b/src/_blocks.sass @@ -0,0 +1,20 @@ +/** + * 1. Set all visible elements with default inline, inline-block and block to + * display as blocks. + * + * This might be controversial, but my position is that inline vs block + * display is a visual style and that block display is the most reasonable + * default for consistent styling. Rather than maintaining a mental map of + * which elements are _supposed_ to be inline vs block you can always rely + * on the fact that *all* elements are block by default. Except checkboxes + * and radios of course, because reasons. + */ +article, aside, div, footer, header, hgroup, main, menu, nav, noscript, section, /* structural elements */ +abbr, acronym, blockquote, h1, h2, h3, h4, h5, h6, p, q, /* phrasing elements */ +b, bdo, em, i, ins, hr, mark, pre, s, small, strike, strong, sub, sup, u, wbr, /* typographic elements */ +a, address, cite, code, dd, dfn, dl, dt, figcaption, figure, kbd, ol, ul, samp, time, var, /* data markup elements */ +rp, rt, ruby, /* language elements */ +details, meter, progress, summary, /* interactive elements */ +audio, canvas, embed, img, svg, video, /* embedded content */ +button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea /* form elements */ + display: block /* 1 */ diff --git a/src/_box-sizing.sass b/src/_box-sizing.sass new file mode 100644 index 0000000..20dc26b --- /dev/null +++ b/src/_box-sizing.sass @@ -0,0 +1,14 @@ +/** + * 1. Reset box-sizing on all elements to border-box. + * + * This uses Jon Neal's method of setting the default box-sizing on the root + * html element and then having all other elements inherit box-sizing + * (https://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/). + * This method seems to cause the least number of headaches and override + * issues. + */ +html + box-sizing: border-box /* 1 */ + +*, *::before, *::after + box-sizing: inherit /* 1 */ diff --git a/src/_embedded-content.sass b/src/_embedded-content.sass new file mode 100644 index 0000000..c7fbae5 --- /dev/null +++ b/src/_embedded-content.sass @@ -0,0 +1,29 @@ +/** + * 1. Remove border when inside `a` element in IE 9/10 (from normalize.css). + * + * Note: We don't use a parent `a` because it causes the selector to have + * high specificity and makes it difficult to override. `img` shouldn't + * have borders anyway, so no harm no foul. + */ +img + border: none + +/** + * 1. Remove borders from iframes. This isn't 1995 any more. + */ +iframe + border: none /* 1 */ + +/** + * 1. Prevent modern browsers from displaying `audio` without controls. + * 2. Remove excess height in iOS 5 devices (from normalize.css). + */ +audio:not([controls]) + display: none /* 1 */ + height: 0 /* 2 */ + +/** + * Correct overflow not hidden in IE 9/10/11 (from normalize.css). + */ +svg:not(:root) + overflow: hidden diff --git a/src/_form-elements.sass b/src/_form-elements.sass new file mode 100644 index 0000000..09d1ecd --- /dev/null +++ b/src/_form-elements.sass @@ -0,0 +1,159 @@ +/** + * 1. Fully reset fieldsets removing all default styling. + */ +fieldset + margin: 0 /* 1 */ + padding: 0 /* 1 */ + border: none /* 1 */ + +/** + * 1. Fully reset lengends removing all default styling. + * 2. On Android Chrome browser lengends don't expand to 100%, so we fix that. + */ +legend + border: 0 /* 1 */ + padding: 0 /* 1 */ + width: 100% /* 2 */ + +/** + * Known limitation: by default, Chrome and Safari on OS X allow very limited + * styling of `select`, unless a `border` property is set. + */ +input:not([type="checkbox"]):not([type="radio"]), +optgroup, +select, +textarea, +button + margin: 0 + padding: 0 + border: none + background: none + font: inherit + color: inherit + +/** + * 1. Remove border-radius in Safari. + * 2. Remove glossy background in Safari. + * + * Note that this also removes the dropdown arrow in Safari, which isn't + * ideal but there is little we can do about it. + */ +select + border-radius: 0 /* 1 */ + -webkit-appearance: none /* 2 */ + +/** + * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). + */ +textarea + overflow: auto + +/** + * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). + */ +button + overflow: visible /* 1 */ + +/** + * 1. Address inconsistent `text-transform` inheritance for `button` and + * `select`. All other form control elements do not inherit `text-transform` + * values. Correct `button` style inheritance in Firefox, IE 8/9/10/11, and + * Opera. Correct `select` style inheritance in Firefox + * (from normalize.css). + */ +button, +select + text-transform: none /* 1 */ + +/** + * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). + */ +button, +input + &::-moz-focus-inner + border: 0 /* 1 */ + padding: 0 /* 1 */ + +/** + * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` + * and `video` controls. + * 2. Correct inability to style clickable `input` types in iOS. + * 3. Improve usability and consistency of cursor style between image-type + * `input` and others. + */ +button, +html input[type="button"] /* 1 */, +input[type="submit"], +input[type="reset"] + -webkit-appearance: button /* 2 */ + cursor: pointer /* 3 */ + text-align: left + +/** + * Re-set default cursor for disabled elements. + */ +button[disabled], +html input[disabled] + cursor: default + +/** + * Address Firefox 4+ setting `line-height` on `input` using `!important` in + * the UA stylesheet. + */ +input + line-height: normal + +/** + * Checkboxes and radio inputs are not styleable in most browsers unfortunately, + * so we have to treat them as a special case. + * + * 1. Address box sizing set to `content-box` in IE 8/9/10 (from normalize.css). + * 2. Remove excess padding in IE 8/9/10 (from normalize.css). + */ +input[type="checkbox"], +input[type="radio"] + box-sizing: border-box /* 1 */ + padding: 0 /* 2 */ + +/** + * Fix the cursor style for Chrome's increment/decrement buttons. For certain + * `font-size` values of the `input`, it causes the cursor style of the + * decrement button to change from `default` to `text`. + */ +input[type="number"] + &::-webkit-inner-spin-button, + &::-webkit-outer-spin-button + height: auto + +/** + * 1. Address `appearance` set to `searchfield` in Safari and Chrome which is + * unstylable (from normalize.css). + * 2. Remove inner padding and search cancel button in Safari and Chrome on + * OS X. Safari (but not Chrome) clips the cancel button when the search + * input has padding (and `textfield` appearance) (from normalize.css). + * + * Ideally we'd like to support the native cancel button, but unfortunately + * safar + * + */ +input[type="search"] + -webkit-appearance: textfield /* 1 */ + + &::-webkit-search-cancel-button, + &::-webkit-search-decoration + -webkit-appearance: none /* 2 */ + +/** + * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and + * opacity (Firefox). + * + * Note: On Firefox number inputs do not respect placeholder styling. This is + * a known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1004130) with no + * workaround :(. + */ +::-webkit-input-placeholder + color: inherit /* 1 */ +::-moz-placeholder + opacity: inherit /* 1 */ +:-ms-input-placeholder + color: inherit /* 1 */ diff --git a/src/_hidden.sass b/src/_hidden.sass new file mode 100644 index 0000000..302dcd3 --- /dev/null +++ b/src/_hidden.sass @@ -0,0 +1,8 @@ +/** + * 1. Address `[hidden]` styling not present in IE 8/9/10 and hide the + * `template` element in IE 8/9/10/11, Safari, and Firefox < 22 + * (from normalize.css). + */ +[hidden], +template + display: none /* 1 */ diff --git a/src/_links.sass b/src/_links.sass new file mode 100644 index 0000000..f79de86 --- /dev/null +++ b/src/_links.sass @@ -0,0 +1,12 @@ +/** + * 1. Fully reset link styling. + * 2. Remove gray background color from active links in IE 10 + * (from normalize.css). + */ +a + color: inherit /* 1 */ + text-decoration: none /* 1 */ + background-color: transparent /* 2 */ + + &:link, &:active, &:visited + color: inherit /* 1 */ diff --git a/src/_lists.sass b/src/_lists.sass new file mode 100644 index 0000000..49199d8 --- /dev/null +++ b/src/_lists.sass @@ -0,0 +1,7 @@ +ul, ol + margin: 0 + padding: 0 + list-style-type: none + + ol, ul + padding: 0 diff --git a/src/_responsive.sass b/src/_responsive.sass new file mode 100644 index 0000000..333b1dd --- /dev/null +++ b/src/_responsive.sass @@ -0,0 +1,13 @@ +html + width: 100% + overflow-x: hidden + +input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress + width: 100% + +img, video, object, embed, iframe + height: auto + max-width: 100% + +audio + max-width: 100% diff --git a/src/_tables.sass b/src/_tables.sass new file mode 100644 index 0000000..9e9134c --- /dev/null +++ b/src/_tables.sass @@ -0,0 +1,9 @@ +table + border-collapse: collapse + border-spacing: 0 + +td, th + padding: 0 + +caption + text-align: inherit diff --git a/src/_typography.sass b/src/_typography.sass new file mode 100644 index 0000000..a4dc81b --- /dev/null +++ b/src/_typography.sass @@ -0,0 +1,85 @@ +/** + * 1. Prevent iOS and IE text size adjust after device orientation change + * without disabling user zoom. + */ +html + -ms-text-size-adjust: 100% /* 1 */ + -webkit-text-size-adjust: 100% /* 1 */ + +/** + * 1. Remove all styling from `h1-6` elements. + */ +h1, h2, h3, h4, h5, h6 + margin: 0 /* 1 */ + font-size: inherit /* 1 */ + font-weight: inherit /* 1 */ + +/** + * 1. Remove extra margin around these elements. + */ +p, dl, dd, pre, figure, blockquote + margin: 0 /* 1 */ + +/** + * 1. Ensure that these elements inherit font-style. + */ +i, cite, em, var, address, dfn + font-style: inherit /* 1 */ + +/** + * 1. Ensure that these elements inherit text-decoration. + */ +u, s, strike, del, ins + text-decoration: inherit /* 1 */ + +/** + * 1. Ensure that these elements inherit font-weight. + */ +dfn, strong, th, b + font-weight: inherit /* 1 */ + +small + font-size: inherit + +/** + * 1. Ensure that font-family is inherited. + * 2. Inherit font size in IE. + */ +tt, code, kbd, samp, pre + font-family: inherit /* 1 */ + font-size: inherit /* 2 */ + +/** + * 1. Remove quotation marks. + */ +q + &::before, &::after + content: '' /* 1 */ + content: none /* 1 */ +blockquote, q + quotes: none /* 1 */ + +/** + * 1. Reset styling for `mark` elements. + */ +mark + background-color: inherit /* 1 */ + color: inherit /* 1 */ + +hr + box-sizing: content-box /* 1 */ + height: 0 /* 1 */ + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers + * (from normalize.css). + */ +sub, sup + font-size: 75% + line-height: 0 + position: relative + vertical-align: baseline +sup + top: -0.5em +sub + bottom: -0.25em diff --git a/src/full-reset.sass b/src/full-reset.sass new file mode 100644 index 0000000..df81438 --- /dev/null +++ b/src/full-reset.sass @@ -0,0 +1,19 @@ +@import blocks +@import box-sizing +@import links +@import lists +@import typography +@import embedded-content +@import accessibility +@import tables +@import responsive +@import form-elements +@import hidden + +/** + * 1. Remove default padding on body. + * 2. Normalize line-height. + */ +body + margin: 0 /* 1 */ + line-height: 1 /* 2 */ diff --git a/test/index.html b/test/index.html new file mode 100644 index 0000000..92b05b7 --- /dev/null +++ b/test/index.html @@ -0,0 +1,493 @@ + + + + + + HTML5 Test Page + + + + +
+
+

HTML5 Test Page

+

This is a test page filled with common HTML elements to be used to provide visual feedback whilst building CSS systems and frameworks.

+
+ +
+ +
+
+

Text

+ +
+
+

Headings

+
+ +
+

Heading 1

+

Heading 2

+

Heading 3

+

Heading 4

+
Heading 5
+
Heading 6
+
+ + +
+ +
+

Paragraphs

+ +
+

A paragraph (from the Greek paragraphos, “to write beside” or “written beside”) is a self-contained unit of a discourse in writing dealing with a particular point or idea. A paragraph consists of one or more sentences. Though not required by the syntax of any language, paragraphs are usually an expected part of formal writing, used to organize longer prose.

+
+ + +
+ +
+

Blockquotes

+ +
+
+

A block quotation (also known as a long quotation or extract) is a quotation in a written document, that is set off from the main text as a paragraph, or block of text.

+

It is typically distinguished visually using indentation and a different typeface or smaller size quotation. It may or may not include a citation, usually placed at the bottom.

+ Said no one, ever. +
+
+ + +
+ +
+

Lists

+ +
+

Definition list

+
+
Definition List Title
+
This is a definition list division.
+
+ +

Ordered List

+
    +
  1. List Item 1
  2. +
  3. List Item 2
  4. +
  5. List Item 3
  6. +
+ +

Unordered List

+
    +
  • List Item 1
  • +
  • List Item 2
  • +
  • List Item 3
  • +
+
+ + +
+ +
+

Horizontal rules

+ +
+
+
+ + +
+ +
+

Tabular data

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table Caption
Table Heading 1Table Heading 2Table Heading 3Table Heading 4Table Heading 5
Table Footer 1Table Footer 2Table Footer 3Table Footer 4Table Footer 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
Table Cell 1Table Cell 2Table Cell 3Table Cell 4Table Cell 5
+ + +
+ +
+

Code

+ +
+

Keyboard input: Cmd

+

Inline code: <div>code</div>

+

Sample output: This is sample output from a computer program.

+ +

Pre-formatted text

+ +
P R E F O R M A T T E D T E X T
+! " # $ % & ' ( ) * + , - . /
+0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+@ A B C D E F G H I J K L M N O
+P Q R S T U V W X Y Z [ \ ] ^ _
+` a b c d e f g h i j k l m n o
+p q r s t u v w x y z { | } ~ 
+
+ + +
+ +
+

Inline elements

+ +
+

This is a text link.

+ +

Strong is used to indicate strong importance.

+ +

This text has added emphasis.

+ +

The b element is stylistically different text from normal text, without any special importance.

+ +

The i element is text that is offset from the normal text.

+ +

The u element is text with an unarticulated, though explicitly rendered, non-textual annotation.

+ +

This text is deleted and This text is inserted.

+ +

This text has a strikethrough.

+ +

Superscript®.

+ +

Subscript for things like H2O.

+ +

This small text is small for for fine print, etc.

+ +

Abbreviation: HTML

+ +

This text is a short inline quotation.

+ +

This is a citation. + +

The dfn element indicates a definition.

+ +

The mark element indicates a highlight.

+ +

The variable element, such as x = y.

+ +

The time element:

+
+ + +
+
+ +
+

Embedded content

+ +
+

Images

+
+

No <figure> element

+

Image alt text

+

Linked image

+ Image alt text +

Wrapped in a <figure> element, no <figcaption>

+
Image alt text
+

Wrapped in a <figure> element, with a <figcaption>

+
+ Image alt text +
Here is a caption for this image.
+
+
+ +
+ +
+

Audio

+
+ +
+ +
+

Video

+
+ +
+ +
+

Canvas

+
canvas
+ +
+ +
+

Meter

+
2 out of 10
+ +
+ +
+

Progress

+
progress
+ +
+ +
+

Inline SVG

+
+ +
+ + +
+ +
+

Form elements

+ +
+
+ Input fields + +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+ +

[Top]

+ +
+ Select menus + +

+ + +

+
+ +

[Top]

+ +
+ Checkboxes + +
    +
  • +
  • +
  • +
+
+ +

[Top]

+ +
+ Radio buttons + +
    +
  • +
  • +
  • +
+
+ +

[Top]

+ +
+ Textareas + +

+ + +

+
+ +

[Top]

+ +
+ HTML5 inputs + +

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+ +

[Top]

+ +
+ Action buttons + +

+ + + + +

+
+ +

[Top]

+
+
+
+ + +
+ + From 246fc7259ea4ab2289f26585b1ddef03023e6bb8 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:10:19 -0700 Subject: [PATCH 05/15] Update npm and bower metadata --- bower.json | 17 +++++++++++++++-- package.json | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index bf213e2..a7b75aa 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,25 @@ { "name": "total-reset", "version": "0.1.0", - "description": "A semantic CSS reset that goes all the way.", - "main": "dist/total-reset.css", + "description": "A semantic CSS reset that goes all the way", "authors": [ "M. George Hansen " ], "license": "MPL-2.0", + "keywords": [ + "css", + "reset", + "semantic" + ], + "homepage": "https://github.com/mgeorgehansen/total-reset.css", + "repository": { + "type": "git", + "url": "https://github.com/mgeorgehansen/total-reset.css" + }, + "main": [ + "dist/total-reset.css", + "src/full-reset.sass" + ], "ignore": [ "**/.*", "node_modules", diff --git a/package.json b/package.json index 724eee2..87288ec 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,27 @@ { "name": "total-reset", "version": "0.1.0", - "description": "A semantic CSS reset that goes all the way.", + "description": "A semantic CSS reset that goes all the way", + "license": "MPL-2.0", "keywords": [ "css", - "reset" + "reset", + "semantic" ], + "author": "M. George Hansen ", + "homepage": "https://github.com/mgeorgehansen/total-reset.css", + "repository": "mgeorgehansen/total-reset.css", + "bugs": "https://github.com/mgeorgehansen/total-reset.css/issues", "main": "dist/total-reset.css", + "files": [ + "dist/total-reset.css", + "src/" + ], "scripts": { "prebuild": "npm install", "build": "gulp build", "serve": "npm run prebuild && gulp serve" }, - "author": "M. George Hansen ", - "license": "MPL-2.0", "devDependencies": { "browser-sync": "^2.9.11", "gulp": "^3.9.0", From 227fb74febc116c671ba460bfa707509406f7d2f Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:10:19 -0700 Subject: [PATCH 06/15] Update npm and bower metadata --- bower.json | 17 +++++++++++++++-- package.json | 16 ++++++++++++---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/bower.json b/bower.json index bf213e2..a7b75aa 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,25 @@ { "name": "total-reset", "version": "0.1.0", - "description": "A semantic CSS reset that goes all the way.", - "main": "dist/total-reset.css", + "description": "A semantic CSS reset that goes all the way", "authors": [ "M. George Hansen " ], "license": "MPL-2.0", + "keywords": [ + "css", + "reset", + "semantic" + ], + "homepage": "https://github.com/mgeorgehansen/total-reset.css", + "repository": { + "type": "git", + "url": "https://github.com/mgeorgehansen/total-reset.css" + }, + "main": [ + "dist/total-reset.css", + "src/full-reset.sass" + ], "ignore": [ "**/.*", "node_modules", diff --git a/package.json b/package.json index 724eee2..87288ec 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,27 @@ { "name": "total-reset", "version": "0.1.0", - "description": "A semantic CSS reset that goes all the way.", + "description": "A semantic CSS reset that goes all the way", + "license": "MPL-2.0", "keywords": [ "css", - "reset" + "reset", + "semantic" ], + "author": "M. George Hansen ", + "homepage": "https://github.com/mgeorgehansen/total-reset.css", + "repository": "mgeorgehansen/total-reset.css", + "bugs": "https://github.com/mgeorgehansen/total-reset.css/issues", "main": "dist/total-reset.css", + "files": [ + "dist/total-reset.css", + "src/" + ], "scripts": { "prebuild": "npm install", "build": "gulp build", "serve": "npm run prebuild && gulp serve" }, - "author": "M. George Hansen ", - "license": "MPL-2.0", "devDependencies": { "browser-sync": "^2.9.11", "gulp": "^3.9.0", From 5407c9b2b49ed2636035d8b11dc13e2483b81874 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:11:28 -0700 Subject: [PATCH 07/15] Fix name of css and sass files --- bower.json | 2 +- dist/{full-reset.css => total-reset.css} | 0 dist/{full-reset.min.css => total-reset.min.css} | 0 src/{full-reset.sass => total-reset.sass} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename dist/{full-reset.css => total-reset.css} (100%) rename dist/{full-reset.min.css => total-reset.min.css} (100%) rename src/{full-reset.sass => total-reset.sass} (100%) diff --git a/bower.json b/bower.json index a7b75aa..115436d 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ }, "main": [ "dist/total-reset.css", - "src/full-reset.sass" + "src/total-reset.sass" ], "ignore": [ "**/.*", diff --git a/dist/full-reset.css b/dist/total-reset.css similarity index 100% rename from dist/full-reset.css rename to dist/total-reset.css diff --git a/dist/full-reset.min.css b/dist/total-reset.min.css similarity index 100% rename from dist/full-reset.min.css rename to dist/total-reset.min.css diff --git a/src/full-reset.sass b/src/total-reset.sass similarity index 100% rename from src/full-reset.sass rename to src/total-reset.sass From 694e99c71ae04e73b21e247b84cd018dfd00c5a0 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:11:28 -0700 Subject: [PATCH 08/15] Fix name of css and sass files --- bower.json | 2 +- dist/{full-reset.css => total-reset.css} | 0 dist/{full-reset.min.css => total-reset.min.css} | 0 src/{full-reset.sass => total-reset.sass} | 0 4 files changed, 1 insertion(+), 1 deletion(-) rename dist/{full-reset.css => total-reset.css} (100%) rename dist/{full-reset.min.css => total-reset.min.css} (100%) rename src/{full-reset.sass => total-reset.sass} (100%) diff --git a/bower.json b/bower.json index a7b75aa..115436d 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ }, "main": [ "dist/total-reset.css", - "src/full-reset.sass" + "src/total-reset.sass" ], "ignore": [ "**/.*", diff --git a/dist/full-reset.css b/dist/total-reset.css similarity index 100% rename from dist/full-reset.css rename to dist/total-reset.css diff --git a/dist/full-reset.min.css b/dist/total-reset.min.css similarity index 100% rename from dist/full-reset.min.css rename to dist/total-reset.min.css diff --git a/src/full-reset.sass b/src/total-reset.sass similarity index 100% rename from src/full-reset.sass rename to src/total-reset.sass From 97a5a88bcd1755007e866f8d30f3a0b5ce92886c Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:22:18 -0700 Subject: [PATCH 09/15] Fix git url is bower.json --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 115436d..6326537 100644 --- a/bower.json +++ b/bower.json @@ -14,7 +14,7 @@ "homepage": "https://github.com/mgeorgehansen/total-reset.css", "repository": { "type": "git", - "url": "https://github.com/mgeorgehansen/total-reset.css" + "url": "git://github.com/mgeorgehansen/total-reset.css.git" }, "main": [ "dist/total-reset.css", From c36ff4fcf33cb7d4b8cec480dce0779c47c659c0 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:22:18 -0700 Subject: [PATCH 10/15] Fix git url is bower.json --- bower.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bower.json b/bower.json index 115436d..6326537 100644 --- a/bower.json +++ b/bower.json @@ -14,7 +14,7 @@ "homepage": "https://github.com/mgeorgehansen/total-reset.css", "repository": { "type": "git", - "url": "https://github.com/mgeorgehansen/total-reset.css" + "url": "git://github.com/mgeorgehansen/total-reset.css.git" }, "main": [ "dist/total-reset.css", From 82b1c353920c587c97612fc4b2ecdae2e2d9e031 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:32:34 -0700 Subject: [PATCH 11/15] Add npm license and version shields to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d13f8ca..0434e7a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ > A semantic CSS reset that goes all the way. +[![npm][npm-image]][npm-url] [![license][license-image]][license-url] + total-reset.css takes the cross-browser fixes from the venerable normalize.css but removes all of the opinionated base element styling, sets _all elements_ to `display: block` and `box-sizing: border-box`, and generally tries to provide a @@ -90,3 +92,8 @@ to your semantics. * [Chris Bracco](https://github.com/cbracco) for his excellent [html5-test-page](https://github.com/cbracco/html5-test-page), which was used to test all of the reset styles for total-reset.css. + +[license-image]: https://img.shields.io/npm/l/total-reset.svg?style=flat-square +[license-url]: LICENSE.md +[npm-image]: https://img.shields.io/npm/v/total-reset.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/total-reset From 18b3ded4702f0187c5e0bd2e8e76816760ead84c Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Thu, 3 Nov 2016 16:32:34 -0700 Subject: [PATCH 12/15] Add npm license and version shields to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index d13f8ca..0434e7a 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ > A semantic CSS reset that goes all the way. +[![npm][npm-image]][npm-url] [![license][license-image]][license-url] + total-reset.css takes the cross-browser fixes from the venerable normalize.css but removes all of the opinionated base element styling, sets _all elements_ to `display: block` and `box-sizing: border-box`, and generally tries to provide a @@ -90,3 +92,8 @@ to your semantics. * [Chris Bracco](https://github.com/cbracco) for his excellent [html5-test-page](https://github.com/cbracco/html5-test-page), which was used to test all of the reset styles for total-reset.css. + +[license-image]: https://img.shields.io/npm/l/total-reset.svg?style=flat-square +[license-url]: LICENSE.md +[npm-image]: https://img.shields.io/npm/v/total-reset.svg?style=flat-square +[npm-url]: https://www.npmjs.com/package/total-reset From 71d96ab639de4a2a3d5f8c3b273f40c770788e2a Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Fri, 4 Nov 2016 15:33:06 -0700 Subject: [PATCH 13/15] Switch to SCSS syntax to resolve abiguous syntax issues in SASS --- bower.json | 2 +- dist/total-reset.css | 113 ++++++++++++---- dist/total-reset.min.css | 2 +- gulpfile.js | 4 +- ...accessibility.sass => _accessibility.scss} | 10 +- src/{_blocks.sass => _blocks.scss} | 5 +- src/{_box-sizing.sass => _box-sizing.scss} | 10 +- ...ed-content.sass => _embedded-content.scss} | 22 +-- ...form-elements.sass => _form-elements.scss} | 126 ++++++++++-------- src/{_hidden.sass => _hidden.scss} | 5 +- src/_links.sass | 12 -- src/_links.scss | 14 ++ src/_lists.sass | 7 - src/_lists.scss | 9 ++ src/_responsive.sass | 13 -- src/_responsive.scss | 17 +++ src/_tables.sass | 9 -- src/_tables.scss | 12 ++ src/_typography.sass | 85 ------------ src/_typography.scss | 101 ++++++++++++++ src/total-reset.sass | 19 --- src/total-reset.scss | 20 +++ 22 files changed, 365 insertions(+), 252 deletions(-) rename src/{_accessibility.sass => _accessibility.scss} (92%) rename src/{_blocks.sass => _blocks.scss} (96%) rename src/{_box-sizing.sass => _box-sizing.scss} (81%) rename src/{_embedded-content.sass => _embedded-content.scss} (77%) rename src/{_form-elements.sass => _form-elements.scss} (71%) rename src/{_hidden.sass => _hidden.scss} (82%) delete mode 100644 src/_links.sass create mode 100644 src/_links.scss delete mode 100644 src/_lists.sass create mode 100644 src/_lists.scss delete mode 100644 src/_responsive.sass create mode 100644 src/_responsive.scss delete mode 100644 src/_tables.sass create mode 100644 src/_tables.scss delete mode 100644 src/_typography.sass create mode 100644 src/_typography.scss delete mode 100644 src/total-reset.sass create mode 100644 src/total-reset.scss diff --git a/bower.json b/bower.json index 6326537..0125b7f 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,7 @@ }, "main": [ "dist/total-reset.css", - "src/total-reset.sass" + "src/total-reset.scss" ], "ignore": [ "**/.*", diff --git a/dist/total-reset.css b/dist/total-reset.css index 630f692..a880184 100644 --- a/dist/total-reset.css +++ b/dist/total-reset.css @@ -9,8 +9,16 @@ * on the fact that *all* elements are block by default. Except checkboxes * and radios of course, because reasons. */ +article, aside, div, footer, header, hgroup, main, menu, nav, noscript, section, +abbr, acronym, blockquote, h1, h2, h3, h4, h5, h6, p, q, +b, bdo, em, i, ins, hr, mark, pre, s, small, strike, strong, sub, sup, u, wbr, +a, address, cite, code, dd, dfn, dl, dt, figcaption, figure, kbd, ol, ul, samp, time, var, +rp, rt, ruby, +details, meter, progress, summary, +audio, canvas, embed, img, svg, video, button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea { - display: block; } + display: block; + /* 1 */ } /** * 1. Reset box-sizing on all elements to border-box. @@ -34,10 +42,14 @@ html { */ a { color: inherit; + /* 1 */ text-decoration: none; - background-color: transparent; } + /* 1 */ + background-color: transparent; + /* 2 */ } a:link, a:active, a:visited { - color: inherit; } + color: inherit; + /* 1 */ } ul, ol { margin: 0; @@ -52,39 +64,48 @@ ul, ol { */ html { -ms-text-size-adjust: 100%; - -webkit-text-size-adjust: 100%; } + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 1 */ } /** * 1. Remove all styling from `h1-6` elements. */ h1, h2, h3, h4, h5, h6 { margin: 0; + /* 1 */ font-size: inherit; - font-weight: inherit; } + /* 1 */ + font-weight: inherit; + /* 1 */ } /** * 1. Remove extra margin around these elements. */ p, dl, dd, pre, figure, blockquote { - margin: 0; } + margin: 0; + /* 1 */ } /** * 1. Ensure that these elements inherit font-style. */ i, cite, em, var, address, dfn { - font-style: inherit; } + font-style: inherit; + /* 1 */ } /** * 1. Ensure that these elements inherit text-decoration. */ u, s, strike, del, ins { - text-decoration: inherit; } + text-decoration: inherit; + /* 1 */ } /** * 1. Ensure that these elements inherit font-weight. */ dfn, strong, th, b { - font-weight: inherit; } + font-weight: inherit; + /* 1 */ } small { font-size: inherit; } @@ -95,24 +116,31 @@ small { */ tt, code, kbd, samp, pre { font-family: inherit; - font-size: inherit; } + /* 1 */ + font-size: inherit; + /* 2 */ } /** * 1. Remove quotation marks. */ q::before, q::after { content: ""; - content: none; } + /* 1 */ + content: none; + /* 1 */ } blockquote, q { - quotes: none; } + quotes: none; + /* 1 */ } /** * 1. Reset styling for `mark` elements. */ mark { background-color: inherit; - color: inherit; } + /* 1 */ + color: inherit; + /* 1 */ } hr { box-sizing: content-box; @@ -148,7 +176,8 @@ img { * 1. Remove borders from iframes. This isn't 1995 any more. */ iframe { - border: none; } + border: none; + /* 1 */ } /** * 1. Prevent modern browsers from displaying `audio` without controls. @@ -156,7 +185,9 @@ iframe { */ audio:not([controls]) { display: none; - height: 0; } + /* 1 */ + height: 0; + /* 2 */ } /** * Correct overflow not hidden in IE 9/10/11 (from normalize.css). @@ -217,8 +248,11 @@ audio { */ fieldset { margin: 0; + /* 1 */ padding: 0; - border: none; } + /* 1 */ + border: none; + /* 1 */ } /** * 1. Fully reset lengends removing all default styling. @@ -226,8 +260,11 @@ fieldset { */ legend { border: 0; + /* 1 */ padding: 0; - width: 100%; } + /* 1 */ + width: 100%; + /* 2 */ } /** * Known limitation: by default, Chrome and Safari on OS X allow very limited @@ -254,7 +291,9 @@ button { */ select { border-radius: 0; - -webkit-appearance: none; } + /* 1 */ + -webkit-appearance: none; + /* 2 */ } /** * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). @@ -266,7 +305,8 @@ textarea { * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). */ button { - overflow: visible; } + overflow: visible; + /* 1 */ } /** * 1. Address inconsistent `text-transform` inheritance for `button` and @@ -277,7 +317,8 @@ button { */ button, select { - text-transform: none; } + text-transform: none; + /* 1 */ } /** * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). @@ -285,7 +326,9 @@ select { button::-moz-focus-inner, input::-moz-focus-inner { border: 0; - padding: 0; } + /* 1 */ + padding: 0; + /* 1 */ } /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` @@ -299,7 +342,9 @@ html input[type="button"], input[type="submit"], input[type="reset"] { -webkit-appearance: button; + /* 2 */ cursor: pointer; + /* 3 */ text-align: left; } /** @@ -326,7 +371,9 @@ input { input[type="checkbox"], input[type="radio"] { box-sizing: border-box; - padding: 0; } + /* 1 */ + padding: 0; + /* 2 */ } /** * Fix the cursor style for Chrome's increment/decrement buttons. For certain @@ -348,9 +395,11 @@ input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-o * */ input[type="search"] { - -webkit-appearance: textfield; } + -webkit-appearance: textfield; + /* 1 */ } input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { - -webkit-appearance: none; } + -webkit-appearance: none; + /* 2 */ } /** * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and @@ -361,13 +410,16 @@ input[type="search"] { * workaround :(. */ ::-webkit-input-placeholder { - color: inherit; } + color: inherit; + /* 1 */ } ::-moz-placeholder { - opacity: inherit; } + opacity: inherit; + /* 1 */ } :-ms-input-placeholder { - color: inherit; } + color: inherit; + /* 1 */ } /** * 1. Address `[hidden]` styling not present in IE 8/9/10 and hide the @@ -376,7 +428,8 @@ input[type="search"] { */ [hidden], template { - display: none; } + display: none; + /* 1 */ } /** * 1. Remove default padding on body. @@ -384,4 +437,6 @@ template { */ body { margin: 0; - line-height: 1; } + /* 1 */ + line-height: 1; + /* 2 */ } diff --git a/dist/total-reset.min.css b/dist/total-reset.min.css index 3de91fa..8851921 100644 --- a/dist/total-reset.min.css +++ b/dist/total-reset.min.css @@ -1 +1 @@ -b,dfn,h1,h2,h3,h4,h5,h6,strong,th{font-weight:inherit}h1,h2,h3,h4,h5,h6,small{font-size:inherit}[title],a{text-decoration:none}button,html,input:not([type=checkbox]):not([type=radio]),legend,meter,progress,select,textarea{width:100%}fieldset,iframe,img{border:none}a,a:active,a:link,a:visited,mark{color:inherit}button,datalist,fieldset,form,input:not([type=checkbox]):not([type=radio]),keygen,label,output,select,textarea{display:block}html{box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;overflow-x:hidden}*,::after,::before{box-sizing:inherit}a{background-color:transparent}ol,ul{margin:0;padding:0;list-style-type:none}ol ol,ol ul,td,th,ul ol,ul ul{padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,p,pre{margin:0}address,cite,dfn,em,i,var{font-style:inherit}del,ins,s,strike,u{text-decoration:inherit}code,kbd,pre,samp,tt{font-family:inherit;font-size:inherit}q::after,q::before{content:"";content:none}blockquote,q{quotes:none}mark{background-color:inherit}hr{box-sizing:content-box;height:0}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}:focus{outline:0}table{border-collapse:collapse;border-spacing:0}caption{text-align:inherit}embed,iframe,img,object,video{height:auto;max-width:100%}audio{max-width:100%}fieldset{margin:0;padding:0}legend{border:0;padding:0}button,input:not([type=checkbox]):not([type=radio]),optgroup,select,textarea{margin:0;padding:0;border:none;background:0 0;font:inherit;color:inherit}select{border-radius:0;-webkit-appearance:none}textarea{overflow:auto}button{overflow:visible}button,select{text-transform:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button,html input[type=button],input[type=submit],input[type=reset]{-webkit-appearance:button;cursor:pointer;text-align:left}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit}::-moz-placeholder{opacity:inherit}:-ms-input-placeholder{color:inherit}[hidden],template{display:none}body{margin:0;line-height:1} \ No newline at end of file +b,dfn,h1,h2,h3,h4,h5,h6,strong,th{font-weight:inherit}h1,h2,h3,h4,h5,h6,small{font-size:inherit}[title],a{text-decoration:none}button,html,input:not([type=checkbox]):not([type=radio]),legend,meter,progress,select,textarea{width:100%}fieldset,iframe,img{border:none}a,a:active,a:link,a:visited,mark{color:inherit}a,abbr,acronym,address,article,aside,audio,b,bdo,blockquote,button,canvas,cite,code,datalist,dd,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,hr,i,img,input:not([type=checkbox]):not([type=radio]),ins,kbd,keygen,label,main,mark,menu,meter,nav,noscript,ol,output,p,pre,progress,q,rp,rt,ruby,s,samp,section,select,small,strike,strong,sub,summary,sup,svg,textarea,time,u,ul,var,video,wbr{display:block}html{box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;overflow-x:hidden}*,::after,::before{box-sizing:inherit}a{background-color:transparent}ol,ul{margin:0;padding:0;list-style-type:none}ol ol,ol ul,td,th,ul ol,ul ul{padding:0}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,p,pre{margin:0}address,cite,dfn,em,i,var{font-style:inherit}del,ins,s,strike,u{text-decoration:inherit}code,kbd,pre,samp,tt{font-family:inherit;font-size:inherit}q::after,q::before{content:"";content:none}blockquote,q{quotes:none}mark{background-color:inherit}hr{box-sizing:content-box;height:0}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}audio:not([controls]){display:none;height:0}svg:not(:root){overflow:hidden}:focus{outline:0}table{border-collapse:collapse;border-spacing:0}caption{text-align:inherit}embed,iframe,img,object,video{height:auto;max-width:100%}audio{max-width:100%}fieldset{margin:0;padding:0}legend{border:0;padding:0}button,input:not([type=checkbox]):not([type=radio]),optgroup,select,textarea{margin:0;padding:0;border:none;background:0 0;font:inherit;color:inherit}select{border-radius:0;-webkit-appearance:none}textarea{overflow:auto}button{overflow:visible}button,select{text-transform:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}button,html input[type=button],input[type=submit],input[type=reset]{-webkit-appearance:button;cursor:pointer;text-align:left}button[disabled],html input[disabled]{cursor:default}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit}::-moz-placeholder{opacity:inherit}:-ms-input-placeholder{color:inherit}[hidden],template{display:none}body{margin:0;line-height:1} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index a19f54f..d1d71ad 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -9,7 +9,7 @@ var distDir = 'dist'; var srcDir = 'src'; gulp.task('build', function() { - return gulp.src(srcDir + '/**/[^_]*.sass') + return gulp.src(srcDir + '/**/[^_]*.scss') .pipe(gulpSass()).on('error', gulpSass.logError) .pipe(gulp.dest(distDir)) .pipe(browserSync.stream()) @@ -32,7 +32,7 @@ gulp.task('serve', ['build'], function() { }); gulp.watch('test/**/*.html').on('change', browserSync.reload); - gulp.watch(srcDir + '/**/*.sass', ['build']); + gulp.watch(srcDir + '/**/*.scss', ['build']); }); gulp.task('default', ['build']) diff --git a/src/_accessibility.sass b/src/_accessibility.scss similarity index 92% rename from src/_accessibility.sass rename to src/_accessibility.scss index b39c281..648e2bb 100644 --- a/src/_accessibility.sass +++ b/src/_accessibility.scss @@ -11,13 +11,15 @@ * made for standard and expected behavior, but it is easy enough to add * a focus outline back in the application styling if that's what you want. */ -:focus - outline: none /* 1 */ +:focus { + outline: none; +} /** * 1. Remove the underline that Firefox adds to elements with a title. * * Again, this might be controversal but see the comments on :focus above. */ -[title] - text-decoration: none /* 1 */ +[title] { + text-decoration: none; +} diff --git a/src/_blocks.sass b/src/_blocks.scss similarity index 96% rename from src/_blocks.sass rename to src/_blocks.scss index 9330469..02b3d3c 100644 --- a/src/_blocks.sass +++ b/src/_blocks.scss @@ -16,5 +16,6 @@ a, address, cite, code, dd, dfn, dl, dt, figcaption, figure, kbd, ol, ul, samp, rp, rt, ruby, /* language elements */ details, meter, progress, summary, /* interactive elements */ audio, canvas, embed, img, svg, video, /* embedded content */ -button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea /* form elements */ - display: block /* 1 */ +button, datalist, form, fieldset, input:not([type="checkbox"]):not([type="radio"]), keygen, label, output, select, textarea /* form elements */ { + display: block; /* 1 */ +} diff --git a/src/_box-sizing.sass b/src/_box-sizing.scss similarity index 81% rename from src/_box-sizing.sass rename to src/_box-sizing.scss index 20dc26b..7ec91fb 100644 --- a/src/_box-sizing.sass +++ b/src/_box-sizing.scss @@ -7,8 +7,10 @@ * This method seems to cause the least number of headaches and override * issues. */ -html - box-sizing: border-box /* 1 */ +html { + box-sizing: border-box; +} -*, *::before, *::after - box-sizing: inherit /* 1 */ +*, *::before, *::after { + box-sizing: inherit; +} diff --git a/src/_embedded-content.sass b/src/_embedded-content.scss similarity index 77% rename from src/_embedded-content.sass rename to src/_embedded-content.scss index c7fbae5..081d2aa 100644 --- a/src/_embedded-content.sass +++ b/src/_embedded-content.scss @@ -5,25 +5,29 @@ * high specificity and makes it difficult to override. `img` shouldn't * have borders anyway, so no harm no foul. */ -img - border: none +img { + border: none; +} /** * 1. Remove borders from iframes. This isn't 1995 any more. */ -iframe - border: none /* 1 */ +iframe { + border: none; /* 1 */ +} /** * 1. Prevent modern browsers from displaying `audio` without controls. * 2. Remove excess height in iOS 5 devices (from normalize.css). */ -audio:not([controls]) - display: none /* 1 */ - height: 0 /* 2 */ +audio:not([controls]) { + display: none; /* 1 */ + height: 0; /* 2 */ +} /** * Correct overflow not hidden in IE 9/10/11 (from normalize.css). */ -svg:not(:root) - overflow: hidden +svg:not(:root) { + overflow: hidden; +} diff --git a/src/_form-elements.sass b/src/_form-elements.scss similarity index 71% rename from src/_form-elements.sass rename to src/_form-elements.scss index 09d1ecd..8669799 100644 --- a/src/_form-elements.sass +++ b/src/_form-elements.scss @@ -1,19 +1,21 @@ /** * 1. Fully reset fieldsets removing all default styling. */ -fieldset - margin: 0 /* 1 */ - padding: 0 /* 1 */ - border: none /* 1 */ +fieldset { + margin: 0; /* 1 */ + padding: 0; /* 1 */ + border: none; /* 1 */ +} /** * 1. Fully reset lengends removing all default styling. * 2. On Android Chrome browser lengends don't expand to 100%, so we fix that. */ -legend - border: 0 /* 1 */ - padding: 0 /* 1 */ - width: 100% /* 2 */ +legend { + border: 0; /* 1 */ + padding: 0; /* 1 */ + width: 100%; /* 2 */ +} /** * Known limitation: by default, Chrome and Safari on OS X allow very limited @@ -23,13 +25,14 @@ input:not([type="checkbox"]):not([type="radio"]), optgroup, select, textarea, -button - margin: 0 - padding: 0 - border: none - background: none - font: inherit - color: inherit +button { + margin: 0; + padding: 0; + border: none; + background: none; + font: inherit; + color: inherit; +} /** * 1. Remove border-radius in Safari. @@ -38,21 +41,24 @@ button * Note that this also removes the dropdown arrow in Safari, which isn't * ideal but there is little we can do about it. */ -select - border-radius: 0 /* 1 */ - -webkit-appearance: none /* 2 */ +select { + border-radius: 0; /* 1 */ + -webkit-appearance: none; /* 2 */ +} /** * Remove default vertical scrollbar in IE 8/9/10/11 (from normalize.css). */ -textarea - overflow: auto +textarea { + overflow: auto; +} /** * 1. Address `overflow` set to `hidden` in IE 8/9/10/11 (from normalize.css). */ -button - overflow: visible /* 1 */ +button { + overflow: visible; /* 1 */ +} /** * 1. Address inconsistent `text-transform` inheritance for `button` and @@ -62,17 +68,20 @@ button * (from normalize.css). */ button, -select - text-transform: none /* 1 */ +select { + text-transform: none; /* 1 */ +} /** * 1. Remove inner padding and border in Firefox 4+ (from normalize.css). */ button, -input - &::-moz-focus-inner - border: 0 /* 1 */ - padding: 0 /* 1 */ +input { + &::-moz-focus-inner { + border: 0; /* 1 */ + padding: 0; /* 1 */ + } +} /** * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio` @@ -82,26 +91,29 @@ input * `input` and others. */ button, -html input[type="button"] /* 1 */, +html input[type="button"], /* 1 */ input[type="submit"], -input[type="reset"] - -webkit-appearance: button /* 2 */ - cursor: pointer /* 3 */ - text-align: left +input[type="reset"] { + -webkit-appearance: button; /* 2 */ + cursor: pointer; /* 3 */ + text-align: left; +} /** * Re-set default cursor for disabled elements. */ button[disabled], -html input[disabled] - cursor: default +html input[disabled] { + cursor: default; +} /** * Address Firefox 4+ setting `line-height` on `input` using `!important` in * the UA stylesheet. */ -input - line-height: normal +input { + line-height: normal; +} /** * Checkboxes and radio inputs are not styleable in most browsers unfortunately, @@ -111,19 +123,22 @@ input * 2. Remove excess padding in IE 8/9/10 (from normalize.css). */ input[type="checkbox"], -input[type="radio"] - box-sizing: border-box /* 1 */ - padding: 0 /* 2 */ +input[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} /** * Fix the cursor style for Chrome's increment/decrement buttons. For certain * `font-size` values of the `input`, it causes the cursor style of the * decrement button to change from `default` to `text`. */ -input[type="number"] +input[type="number"] { &::-webkit-inner-spin-button, - &::-webkit-outer-spin-button - height: auto + &::-webkit-outer-spin-button { + height: auto; + } +} /** * 1. Address `appearance` set to `searchfield` in Safari and Chrome which is @@ -136,12 +151,14 @@ input[type="number"] * safar * */ -input[type="search"] - -webkit-appearance: textfield /* 1 */ +input[type="search"] { + -webkit-appearance: textfield; /* 1 */ &::-webkit-search-cancel-button, - &::-webkit-search-decoration - -webkit-appearance: none /* 2 */ + &::-webkit-search-decoration { + -webkit-appearance: none; /* 2 */ + } +} /** * 1. Update input placeholders to inherit color (IE, Chrome and Safari) and @@ -151,9 +168,12 @@ input[type="search"] * a known bug (https://bugzilla.mozilla.org/show_bug.cgi?id=1004130) with no * workaround :(. */ -::-webkit-input-placeholder - color: inherit /* 1 */ -::-moz-placeholder - opacity: inherit /* 1 */ -:-ms-input-placeholder - color: inherit /* 1 */ +::-webkit-input-placeholder { + color: inherit; /* 1 */ +} +::-moz-placeholder { + opacity: inherit; /* 1 */ +} +:-ms-input-placeholder { + color: inherit; /* 1 */ +}; diff --git a/src/_hidden.sass b/src/_hidden.scss similarity index 82% rename from src/_hidden.sass rename to src/_hidden.scss index 302dcd3..a2fb0e7 100644 --- a/src/_hidden.sass +++ b/src/_hidden.scss @@ -4,5 +4,6 @@ * (from normalize.css). */ [hidden], -template - display: none /* 1 */ +template { + display: none; /* 1 */ +} diff --git a/src/_links.sass b/src/_links.sass deleted file mode 100644 index f79de86..0000000 --- a/src/_links.sass +++ /dev/null @@ -1,12 +0,0 @@ -/** - * 1. Fully reset link styling. - * 2. Remove gray background color from active links in IE 10 - * (from normalize.css). - */ -a - color: inherit /* 1 */ - text-decoration: none /* 1 */ - background-color: transparent /* 2 */ - - &:link, &:active, &:visited - color: inherit /* 1 */ diff --git a/src/_links.scss b/src/_links.scss new file mode 100644 index 0000000..c8ea658 --- /dev/null +++ b/src/_links.scss @@ -0,0 +1,14 @@ +/** + * 1. Fully reset link styling. + * 2. Remove gray background color from active links in IE 10 + * (from normalize.css). + */ +a { + color: inherit; /* 1 */ + text-decoration: none; /* 1 */ + background-color: transparent; /* 2 */ + + &:link, &:active, &:visited { + color: inherit; /* 1 */ + } +} diff --git a/src/_lists.sass b/src/_lists.sass deleted file mode 100644 index 49199d8..0000000 --- a/src/_lists.sass +++ /dev/null @@ -1,7 +0,0 @@ -ul, ol - margin: 0 - padding: 0 - list-style-type: none - - ol, ul - padding: 0 diff --git a/src/_lists.scss b/src/_lists.scss new file mode 100644 index 0000000..61f2550 --- /dev/null +++ b/src/_lists.scss @@ -0,0 +1,9 @@ +ul, ol { + margin: 0; + padding: 0; + list-style-type: none; + + ol, ul { + padding: 0; + } +} diff --git a/src/_responsive.sass b/src/_responsive.sass deleted file mode 100644 index 333b1dd..0000000 --- a/src/_responsive.sass +++ /dev/null @@ -1,13 +0,0 @@ -html - width: 100% - overflow-x: hidden - -input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress - width: 100% - -img, video, object, embed, iframe - height: auto - max-width: 100% - -audio - max-width: 100% diff --git a/src/_responsive.scss b/src/_responsive.scss new file mode 100644 index 0000000..44d9f07 --- /dev/null +++ b/src/_responsive.scss @@ -0,0 +1,17 @@ +html { + width: 100%; + overflow-x: hidden; +} + +input:not([type="checkbox"]):not([type="radio"]), select, textarea, button, meter, progress { + width: 100%; +} + +img, video, object, embed, iframe { + height: auto; + max-width: 100%; +} + +audio { + max-width: 100%; +} diff --git a/src/_tables.sass b/src/_tables.sass deleted file mode 100644 index 9e9134c..0000000 --- a/src/_tables.sass +++ /dev/null @@ -1,9 +0,0 @@ -table - border-collapse: collapse - border-spacing: 0 - -td, th - padding: 0 - -caption - text-align: inherit diff --git a/src/_tables.scss b/src/_tables.scss new file mode 100644 index 0000000..62853d5 --- /dev/null +++ b/src/_tables.scss @@ -0,0 +1,12 @@ +table { + border-collapse: collapse; + border-spacing: 0; +} + +td, th { + padding: 0; +} + +caption { + text-align: inherit; +} diff --git a/src/_typography.sass b/src/_typography.sass deleted file mode 100644 index a4dc81b..0000000 --- a/src/_typography.sass +++ /dev/null @@ -1,85 +0,0 @@ -/** - * 1. Prevent iOS and IE text size adjust after device orientation change - * without disabling user zoom. - */ -html - -ms-text-size-adjust: 100% /* 1 */ - -webkit-text-size-adjust: 100% /* 1 */ - -/** - * 1. Remove all styling from `h1-6` elements. - */ -h1, h2, h3, h4, h5, h6 - margin: 0 /* 1 */ - font-size: inherit /* 1 */ - font-weight: inherit /* 1 */ - -/** - * 1. Remove extra margin around these elements. - */ -p, dl, dd, pre, figure, blockquote - margin: 0 /* 1 */ - -/** - * 1. Ensure that these elements inherit font-style. - */ -i, cite, em, var, address, dfn - font-style: inherit /* 1 */ - -/** - * 1. Ensure that these elements inherit text-decoration. - */ -u, s, strike, del, ins - text-decoration: inherit /* 1 */ - -/** - * 1. Ensure that these elements inherit font-weight. - */ -dfn, strong, th, b - font-weight: inherit /* 1 */ - -small - font-size: inherit - -/** - * 1. Ensure that font-family is inherited. - * 2. Inherit font size in IE. - */ -tt, code, kbd, samp, pre - font-family: inherit /* 1 */ - font-size: inherit /* 2 */ - -/** - * 1. Remove quotation marks. - */ -q - &::before, &::after - content: '' /* 1 */ - content: none /* 1 */ -blockquote, q - quotes: none /* 1 */ - -/** - * 1. Reset styling for `mark` elements. - */ -mark - background-color: inherit /* 1 */ - color: inherit /* 1 */ - -hr - box-sizing: content-box /* 1 */ - height: 0 /* 1 */ - -/** - * Prevent `sub` and `sup` affecting `line-height` in all browsers - * (from normalize.css). - */ -sub, sup - font-size: 75% - line-height: 0 - position: relative - vertical-align: baseline -sup - top: -0.5em -sub - bottom: -0.25em diff --git a/src/_typography.scss b/src/_typography.scss new file mode 100644 index 0000000..2342518 --- /dev/null +++ b/src/_typography.scss @@ -0,0 +1,101 @@ +/** + * 1. Prevent iOS and IE text size adjust after device orientation change + * without disabling user zoom. + */ +html { + -ms-text-size-adjust: 100%; /* 1 */ + -webkit-text-size-adjust: 100%; /* 1 */ +} + +/** + * 1. Remove all styling from `h1-6` elements. + */ +h1, h2, h3, h4, h5, h6 { + margin: 0; /* 1 */ + font-size: inherit; /* 1 */ + font-weight: inherit; /* 1 */ +} + +/** + * 1. Remove extra margin around these elements. + */ +p, dl, dd, pre, figure, blockquote { + margin: 0; /* 1 */ +} + +/** + * 1. Ensure that these elements inherit font-style. + */ +i, cite, em, var, address, dfn { + font-style: inherit; /* 1 */ +} + +/** + * 1. Ensure that these elements inherit text-decoration. + */ +u, s, strike, del, ins { + text-decoration: inherit; /* 1 */ +} + +/** + * 1. Ensure that these elements inherit font-weight. + */ +dfn, strong, th, b { + font-weight: inherit; /* 1 */ +} + +small { + font-size: inherit; +} + +/** + * 1. Ensure that font-family is inherited. + * 2. Inherit font size in IE. + */ +tt, code, kbd, samp, pre { + font-family: inherit; /* 1 */ + font-size: inherit; /* 2 */ +} + +/** + * 1. Remove quotation marks. + */ +q { + &::before, &::after { + content: ""; /* 1 */ + content: none; /* 1 */ + } +} +blockquote, q { + quotes: none; /* 1 */ +} + +/** + * 1. Reset styling for `mark` elements. + */ +mark { + background-color: inherit; /* 1 */ + color: inherit; /* 1 */ +} + +hr { + box-sizing: content-box; + height: 0; +} + +/** + * Prevent `sub` and `sup` affecting `line-height` in all browsers + * (from normalize.css). + */ +sub, sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} +sup { + top: -0.5em; +} +sub { + bottom: -0.25em; +} diff --git a/src/total-reset.sass b/src/total-reset.sass deleted file mode 100644 index df81438..0000000 --- a/src/total-reset.sass +++ /dev/null @@ -1,19 +0,0 @@ -@import blocks -@import box-sizing -@import links -@import lists -@import typography -@import embedded-content -@import accessibility -@import tables -@import responsive -@import form-elements -@import hidden - -/** - * 1. Remove default padding on body. - * 2. Normalize line-height. - */ -body - margin: 0 /* 1 */ - line-height: 1 /* 2 */ diff --git a/src/total-reset.scss b/src/total-reset.scss new file mode 100644 index 0000000..c1713e6 --- /dev/null +++ b/src/total-reset.scss @@ -0,0 +1,20 @@ +@import "blocks"; +@import "box-sizing"; +@import "links"; +@import "lists"; +@import "typography"; +@import "embedded-content"; +@import "accessibility"; +@import "tables"; +@import "responsive"; +@import "form-elements"; +@import "hidden"; + +/** + * 1. Remove default padding on body. + * 2. Normalize line-height. + */ +body { + margin: 0; /* 1 */ + line-height: 1; /* 2 */ +} From 1e3bc66a0efe8eae6ea6c906697db8da47bb4312 Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Fri, 4 Nov 2016 15:34:54 -0700 Subject: [PATCH 14/15] Fix broken stylesheet reference in test page --- test/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/index.html b/test/index.html index 92b05b7..ffe0449 100644 --- a/test/index.html +++ b/test/index.html @@ -5,7 +5,7 @@ HTML5 Test Page - +
From 27046ce04c0fde289337c9292b82b3f9bebe164e Mon Sep 17 00:00:00 2001 From: "M. George Hansen" Date: Fri, 4 Nov 2016 15:48:41 -0700 Subject: [PATCH 15/15] Bump version to 0.1.1 --- bower.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bower.json b/bower.json index 0125b7f..d5d0c93 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "total-reset", - "version": "0.1.0", + "version": "0.1.1", "description": "A semantic CSS reset that goes all the way", "authors": [ "M. George Hansen " diff --git a/package.json b/package.json index 87288ec..004aaa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "total-reset", - "version": "0.1.0", + "version": "0.1.1", "description": "A semantic CSS reset that goes all the way", "license": "MPL-2.0", "keywords": [