Search code examples
htmlcsssassscss-lint

Using Reset and Normalizer in Scss


I had a question about including reset/normalizer files in scss. When I create a new file, say _normal.scss, and copy/paste the normalizer css into the file, once I save it creates a duplicate css file. So within that folder, I'll have:

  1. normal.scss
  2. normal.css

When I go to my imports file, to @import "../Resets/_normal.scss", should I also be importing the .css file?


Solution

  • You only need it once. Sass can import a CSS just like a SCSS file, so I would advise leaving normalizer as a .css file and placing it in a "vendor" (e.g. @import "../../vendor/normal.css) or "3rdparty" folder in your project but outside of the scope of your Sass converter/watcher. Or better still, include it in your project via NPM. This way you are decoupling your code from the code of 3rd party libraries.