Challenge - 5 Problems
SASS Compilation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2:00remaining
What is the compiled CSS output?
Given this SASS code, what is the compiled CSS output?
SASS
$primary-color: #333; nav { ul { margin: 0; padding: 0; list-style: none; } li { display: inline-block; } a { color: $primary-color; text-decoration: none; } }
Attempts:
2 left
💡 Hint
Remember how nested selectors compile in SASS to CSS.
✗ Incorrect
SASS nested selectors compile by combining parent selectors with nested ones. So 'nav ul' becomes 'nav ul' in CSS, not just 'ul'. Variables like $primary-color are replaced with their values.
🧠 Conceptual
intermediate2:00remaining
What error occurs when compiling this SASS code?
What error will the SASS compiler produce for this code?
SASS
$font-stack: Helvetica, sans-serif $primary-color: #333; body { font: 100% $font-stack; color: $primary-color; }
Attempts:
2 left
💡 Hint
Check variable declarations carefully for punctuation.
✗ Incorrect
In SASS, each variable declaration must end with a semicolon. Missing it causes a syntax error.
❓ selector
advanced2:00remaining
Which CSS selector is generated by this SASS code?
What is the CSS selector generated by this SASS snippet?
SASS
.container { & > .item { color: red; } }
Attempts:
2 left
💡 Hint
The & symbol represents the parent selector exactly.
✗ Incorrect
The & symbol in SASS means 'use the parent selector here'. So '& > .item' becomes '.container > .item' in CSS.
❓ layout
advanced2:00remaining
What is the visual effect of this compiled CSS?
Given this SASS and its compiled CSS, what will you see on the page?
SASS
$gap: 1rem; .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: $gap; }
Attempts:
2 left
💡 Hint
Remember how CSS grid and gap properties work.
✗ Incorrect
The CSS creates a grid with three equal columns and a 1rem gap between grid items, spacing them evenly.
❓ accessibility
expert3:00remaining
Which compiled CSS best supports accessible focus outlines?
Which compiled CSS from the SASS below ensures visible focus outlines for keyboard users?
SASS
a {
color: blue;
&:focus {
outline: 3px solid orange;
}
}Attempts:
2 left
💡 Hint
Focus outlines help keyboard users see where they are on the page.
✗ Incorrect
Only option D applies a visible outline on focus, which is important for accessibility. Option D always shows outline, which is not ideal. Option D uses hover, not focus. Option D removes outline on focus, which is bad.