Challenge - 5 Problems
Color Scale Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate1:30remaining
What is the output color of this Sass function call?
Given the Sass function
lighten($color, $amount), what is the resulting color when you run lighten(#336699, 20%)?SASS
$color: #336699; $result: lighten($color, 20%);
Attempts:
2 left
💡 Hint
Lighten increases the brightness by the given percentage.
✗ Incorrect
The lighten function increases the lightness of the color by 20%, so #336699 becomes #6699cc.
🧠 Conceptual
intermediate1:00remaining
How many colors are generated by this Sass loop?
Consider this Sass code that generates a color scale by darkening a base color in 5 steps:
$base-color: #ff6600;
@for $i from 1 through 5 {
$shade: darken($base-color, $i * 10%);
}
How many distinct colors does this loop create?SASS
$base-color: #ff6600; @for $i from 1 through 5 { $shade: darken($base-color, $i * 10%); }
Attempts:
2 left
💡 Hint
The loop runs from 1 to 5 inclusive.
✗ Incorrect
The loop runs 5 times, each time generating one distinct darker shade, so 5 colors are created.
❓ selector
advanced2:00remaining
Which Sass selector generates a color scale class list correctly?
You want to create CSS classes named
.color-1 to .color-5 each with a different shade of blue. Which Sass code snippet correctly generates these classes with increasing lightness?SASS
$base: #0000ff; @for $i from 1 through 5 { .color-#{$i} { color: lighten($base, $i * 10%); } }
Attempts:
2 left
💡 Hint
Remember Sass @for loops can use 'from' and 'through' to include both ends.
✗ Incorrect
Option B uses @for from 1 through 5, correctly generating classes .color-1 to .color-5 with increasing lightness.
❓ layout
advanced1:30remaining
What visual result does this Sass grid color scale produce?
This Sass code creates a grid of colored squares with a color scale from red to yellow. What will the user see?
SASS
$colors: (red, orange, yellow); .container { display: grid; grid-template-columns: repeat(3, 5rem); gap: 1rem; } @each $color in $colors { .box-#{$color} { background-color: $color; width: 5rem; height: 5rem; } }
Attempts:
2 left
💡 Hint
Grid with 3 columns and gap means squares appear side by side with space.
✗ Incorrect
The grid has 3 columns, so the three colored boxes appear side by side horizontally with spacing.
❓ accessibility
expert2:30remaining
Which Sass color scale approach best improves accessibility for colorblind users?
You want to create a color scale for a website that is friendly for users with color vision deficiencies. Which Sass approach below best supports accessibility?
Attempts:
2 left
💡 Hint
Accessibility means colors should be distinguishable even if hue perception is limited.
✗ Incorrect
Option A uses lightness and saturation changes with constant hue plus text labels, which helps colorblind users distinguish scale steps.