React TutorialLesson 45Free preview
React Sass
This lesson is part of React · All levels
Summary
React supports Sass by adding sass packets and importing the .scss extension file into the component. Sass carries features such as the $ variable, nesting, mixin, and partial that make the stylesheet more structured. The build process then compiles Sass into regular CSS.
Key points
- Install with npm install --save-dev sass
- Import the .scss file directly into the JavaScript file
- Nesting mimics the markup structure to make the selector easier to read
- The $ and partial variables reduce the repetition of the style
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.