0
0
SASSmarkup~20 mins

sass:color module - 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
2:00remaining
Understanding the lighten() function in sass:color module
What is the output color of the following Sass code snippet?
$base-color: #336699;
$result: lighten($base-color, 20%);
@debug $result;
SASS
$base-color: #336699;
$result: lighten($base-color, 20%);
@debug $result;
A#4d80b3
B#2a527f
C#6699cc
D#99bbdd
Attempts:
2 left
💡 Hint
The lighten() function increases the lightness of the color by the given percentage.
📝 Syntax
intermediate
2:00remaining
Correct usage of adjust-hue() function
Which option correctly changes the hue of the color #ff0000 by 90 degrees using adjust-hue() in Sass?
Aadjust-hue(#ff0000, 90deg)
Badjust-hue(#ff0000, 0.25turn)
Cadjust-hue(#ff0000, 90)
Dadjust-hue(#ff0000, 90%)
Attempts:
2 left
💡 Hint
The angle can be given as a number without units, which Sass treats as degrees.
rendering
advanced
2:00remaining
Resulting color from mix() function
What is the resulting color of this Sass code?
$color1: #0000ff;
$color2: #ff0000;
$result: mix($color1, $color2, 25%);
@debug $result;
SASS
$color1: #0000ff;
$color2: #ff0000;
$result: mix($color1, $color2, 25%);
@debug $result;
A#4000bf
B#bf0040
C#3f00bf
D#bf003f
Attempts:
2 left
💡 Hint
The mix() function blends colors weighted by the third parameter, which is the weight of the first color.
selector
advanced
2:00remaining
Using sass:color functions in a selector context
Given this Sass code, what color will the background be for the .highlight class?
.highlight {
  $base: #008000;
  background-color: adjust-hue(lighten($base, 10%), 180);
}
SASS
.highlight {
  $base: #008000;
  background-color: adjust-hue(lighten($base, 10%), 180);
}
A#339933
B#33cccc
C#33cc33
D#cc3333
Attempts:
2 left
💡 Hint
First lighten the green, then rotate the hue by 180 degrees (opposite color).
accessibility
expert
2:00remaining
Determining contrast ratio with sass:color functions
Using Sass's sass:color module, which option correctly calculates the contrast ratio between #ffffff and #777777?
Acontrast(#ffffff, #777777)
Bcontrast-ratio(#ffffff, #777777)
Ccolor.contrast(#ffffff, #777777)
Dcolor.contrast-ratio(#ffffff, #777777)
Attempts:
2 left
💡 Hint
The sass:color module provides a contrast() function to get contrast ratio.