Adding SASS to create-react-app
Installation
In new project, install sass
. https://www.npmjs.com/package/sass#usage
Importing SASS
Rename
App.css
toApp.scss
. Alsoindex.css
toindex.scss
.- In
App.js
andindex.js
fix the import from css to scss. It will result:
Sass Extensions for VS Code
Using SASS
- You can edit the scss either in
App.scss
orindex.scss
for example, clear all code in app.scss
, then add the following: