The normalize.css library for Sass.
There are many attempts to convert normalize.css to Sass
to be found on GitHub — do a search and you will find simple ones to quite nice ( complex ) implementations for reducing the rules load.
Trying out the different approaches available I did not find an elegant library suiting me — until today! Instead of decomposing normalize.css and rebuilding it, why not just modify and enhance the library as little as possible to achieve the goal?
Every selector
in normalize.css is a %selector
in normalizer.scss.
With this approach you only need to
@extend
a required ( normalising ) placeholder selector, avoiding any unnecessary output in the finalCSS
. Sweet!
Caveat : The [hidden]
attribute can not be converted to a placeholder selector and hence I have to revert to the standard approach for inclusion / exclusion. An acceptable trade off.
Have a look at the Literate Source Code version as well as at the resulting clean Sass
counterpart. For the more sceptical guys : check out the ( simple ) test files and let me know, if you find any flaws.
Happy Normalizing!
Without Nicolas Gallagher and Jonathan Neal as well as all the tireless contributors to normalize.css this mental exercise would not have been possible. Thanks guys!
Except where explicitly stated otherwise, all documents / documentation and ( future ) translations in this repository are licensed under the Creative Commons Attribution 3.0 Unported License. ( Source ) Code is licensed under The MIT License.
Based on a work at https://github.com/StefanoRausch/normalizer.scss.
-
Removed the additional customisation features
$normalizer-html-font-family
,$normalizer-h1-font-size
,$normalizer-h1-margin
and$normalizer-small-font-size
to comply with the primary goal of normalizer.scss to allow the reduction of the rules load ( which already is minimal ) in the finalCSS
output file. -
Removed the respective customised tests.
-
Updated the documentation to reduce duplication of the headers.
- Initial commit.