reactjssassnormalize

how to add normalize.css in index.scss file with react app


Currently, I'm working with scss and create-react-app. I'm having problems including normalize to the main file index.scss.

Should like something like: index.css;

@import-normalize; /* bring in normalize.css styles */

/* rest of app styles */

The @import-normalize; doesn't work with scss.

any advice? thanks!!!


Solution

  • @import-normalize; is not something which is exclusively defined in scss.

    You can stick to basic by including the css file in scss by using @import.

    @import "../pathTo/normalise.css";
    

    A better way would be to rename normalise.css to _normalise.scss and include it simply by:

    @import "../pathTo/normalise";
    

    PS: the scss files that start with _ are called partials, and do not create a separate "normalise.css" when all of the scss files are compiled.