Recall & Review
beginner
What is a partial file in Sass?
A partial file in Sass is a file that starts with an underscore (_) and is meant to hold Sass code that you want to include in other Sass files. It won't be compiled into a separate CSS file on its own.
Click to reveal answer
beginner
Why do Sass partial files start with an underscore?
The underscore tells Sass not to compile the file directly. Instead, it is used only when imported into other Sass files.
Click to reveal answer
intermediate
How do you import a partial file in Sass?You use the @use or @import rule without the underscore or file extension. For example, @use 'variables'; will import _variables.scss.Click to reveal answer
intermediate
What happens if you don't use an underscore for a Sass file you want to import?
If the file does not start with an underscore, Sass will compile it into its own CSS file, which might not be what you want if it's just a helper file.
Click to reveal answer
beginner
Can you explain the benefit of using partial files in Sass projects?
Partial files help organize your styles into smaller, manageable pieces. They keep your code clean and reusable without creating extra CSS files.
Click to reveal answer
What does the underscore (_) at the start of a Sass file name mean?
✗ Incorrect
An underscore means the file is a partial and is only included when imported, so it doesn't compile separately.
How do you import a partial file named _colors.scss in Sass?
✗ Incorrect
You import partials without the underscore or file extension using @use or @import.
What happens if you remove the underscore from a partial file name?
✗ Incorrect
Without the underscore, Sass treats the file as a normal file and compiles it separately.
Why use partial files in Sass?
✗ Incorrect
Partials help keep code organized and prevent creating many CSS files.
Which Sass rule is recommended for importing partials in modern Sass?
✗ Incorrect
@use is the modern recommended way to import partials, replacing @import.
Explain what a Sass partial file is and why it starts with an underscore.
Think about how Sass knows which files to compile and which to include only.
You got /4 concepts.
Describe how to import a partial file in Sass and what happens if you forget the underscore in the file name.
Focus on the import syntax and the effect of file naming on compilation.
You got /4 concepts.