0
0
SASSmarkup~20 mins

Lighten and darken functions in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass Color Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
How does the lighten() function affect a color in Sass?
In Sass, what does the lighten() function do to a given color?
AIt decreases the lightness of the color by a specified percentage, making it closer to black.
BIt increases the lightness of the color by a specified percentage, making it closer to white.
CIt increases the saturation of the color by a specified percentage, making it more vivid.
DIt decreases the saturation of the color by a specified percentage, making it more gray.
Attempts:
2 left
💡 Hint
Think about what happens when you add white to a color.
📝 Syntax
intermediate
2:00remaining
What is the output color of this Sass code?
Given the Sass code:
$color: #336699;
$result: lighten($color, 20%);

What is the hex value of $result?
A#6699cc
B#4d80b3
C#003366
D#1a334d
Attempts:
2 left
💡 Hint
Lighten increases lightness by 20%, so the color becomes lighter than #336699.
rendering
advanced
2:00remaining
What color will be rendered by this Sass snippet?
Consider this Sass code:
$base: #cc3300;
$dark: darken($base, 30%);

Which color will $dark represent when rendered in the browser?
A#330000
B#ff6600
C#993300
D#661a00
Attempts:
2 left
💡 Hint
Darken reduces lightness, making the color closer to black.
selector
advanced
1:30remaining
Which Sass selector uses lighten() correctly to style a button hover?
You want to make a button's background color lighter on hover using Sass. Which selector and property usage is correct?
Abutton:hover { background-color: lighten(#0055aa, '15%'); }
Bbutton:hover { background-color: lighten(#0055aa 15%); }
Cbutton:hover { background-color: lighten(#0055aa, 15%); }
Dbutton:hover { background-color: lighten(#0055aa); }
Attempts:
2 left
💡 Hint
Check the syntax for function arguments in Sass.
accessibility
expert
2:30remaining
Why should you be cautious when using lighten() or darken() for accessibility?
When adjusting colors with lighten() or darken() in Sass, what accessibility issue might arise?
AThe contrast ratio between text and background might become too low, making text hard to read.
BThe colors might become too saturated, causing eye strain.
CThe colors might not display correctly on all browsers due to Sass limitations.
DThe lighten() and darken() functions can only be used on grayscale colors.
Attempts:
2 left
💡 Hint
Think about how color contrast affects readability.