Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#638 was closed by saying "This could have a PR for it…", so I made a PR for it!
Quick explanation of what's happening:
eyeglass
fields topackage.json
keyword
field topackage.json
and include theeyeglass-module
keywordfiles
field inpackage.json
to include the requisiteeyeglass-exports.js
file and theto-sass.js
file (more on that in a moment)eyeglass-exports.js
file to tell Eyeglass where the files are storedto-sass.js
file to convertnormalize.css
in to_normalize.scss
after NPM install_normalize.scss
to git ignoreLet me talk through
to-sass.js
because it's likely the most controversial of the additions. Sass cannot import raw CSS files, like what is currently distributed. As such, in order to have full compatibility with Eyeglass as expected for Sass authors, we need a Sass file. This is simple enough, change the.css
extension to.scss
and it can be imported (I also rename it to a Sass partial so it doesn't compile its own file, by prepending_
to the file name). This could be a 1-liner withcp normalize.css _normalize.scss
, but thenpostintall
will fail on terminals that don't have a Bash-compatiblecp
function available. So, I needed to write a tiny file to A) delete_normalize.scss
if it's already there and B) replace it with a clean copy based off ofnormalize.css
making sure it's up-to-date. All of this is done with native Node libraries that are available back to version0.12
of Node, meaning this should work basically everywhere that Node works, and absolutely every version of Node that is not End of Life'dI have tested installing and using Normalize from my branch in a project I already have set up. Presuming Eyeglass is already set up, using it in a Sass file after running
npm install normalize.css --save-dev
is@import 'normalize'
.Resolves #638