0
0
SASSmarkup~20 mins

Partial files with underscore prefix in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass Partial Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why do Sass partial files start with an underscore?
In Sass, partial files often start with an underscore (e.g., _variables.scss). What is the main reason for this naming convention?
AIt marks the file as a backup copy.
BIt makes the file load faster in the browser.
CIt tells Sass not to compile this file directly into CSS.
DIt changes the file's syntax to CSS instead of Sass.
Attempts:
2 left
💡 Hint
Think about how Sass handles files when compiling.
📝 Syntax
intermediate
2:00remaining
Importing a Sass partial file
Given a partial file named _mixins.scss, which import statement correctly includes it in styles.scss?
SASS
/* styles.scss */
@import ???;
A@import '_mixins';
B@import 'mixins';
C@import 'mixins.scss';
D@import '_mixins.scss';
Attempts:
2 left
💡 Hint
When importing, you don't need to include the underscore or file extension.
rendering
advanced
2:00remaining
Output CSS from partial files
If you have two Sass files: _reset.scss and main.scss which imports _reset.scss, what CSS files will be generated after compiling?
AOnly <code>main.css</code> will be generated.
BBoth <code>_reset.css</code> and <code>main.css</code> will be generated.
COnly <code>_reset.css</code> will be generated.
DNo CSS files will be generated.
Attempts:
2 left
💡 Hint
Remember what the underscore means for partial files.
selector
advanced
2:00remaining
Using partials to organize selectors
You have a partial file _buttons.scss with styles for buttons. How should you organize your Sass files to keep your project clean and maintainable?
APut all button styles in <code>_buttons.scss</code> and import it into a main file.
BCreate a CSS file named <code>buttons.css</code> and link it separately in HTML.
CWrite button styles directly in the main CSS file without partials.
DUse inline styles in HTML for buttons instead of Sass.
Attempts:
2 left
💡 Hint
Think about how partials help organize code.
accessibility
expert
3:00remaining
Accessibility considerations when using Sass partials
When using Sass partials to style components, what is an important accessibility practice to keep in mind?
AWrite all styles in one file to avoid missing accessibility rules.
BUse partials only for layout, not for colors or fonts.
CAvoid using variables in partials to prevent confusion.
DEnsure color variables in partials meet contrast standards for readability.
Attempts:
2 left
💡 Hint
Accessibility often involves color contrast and readability.