How to style a React application with SASS
When you use to build a React applicationcreate-react-app
, In terms of style, you have many options to use.
Of course, if you don’t use
create-react-app
, You have all the options in the world, but we only limit the discussion tocreate-react-app
Options provided.
You can use the style attribute or CSS module to start using common classes and CSS files for style settings.
SASS/SCSS is a very popular option, and many developers like it very much.
You can use it from the ground up without any configurationcreate-react-app
2.
You only need one.sass
or.scss
File, and then import it into the component:
import './styles.scss'