Partials in Sass are the files you split up to organize specific functionality in the codebase.
- They use a
_prefix notation in the file name that tells Sass to hold off on compiling the file individually and instead import it.
- To import this partial into the main file - or the file that encapsulates the important rules and the bulk of the project styles - omit the underscore.
For example, to import a file named _variables.scss, add the following line of code:
The global file imports all the components and centralizes the logic.
At the top of main.scss, import the variables partial:
A reminder that
helper refers to resources like variables, mixins, functions, etc. These are the elements that “help” make up the foundation of your codebase as it grows.
Click “Run” to see your changes in the browser and inspect them in the output of main.css.