0
0
SASSmarkup~10 mins

Color scale generation in SASS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define a base color variable in Sass.

SASS
$base-color: [1];
Drag options to blanks, or click blank then click option'
AbaseColor
Bblue
C#3498db
Dcolor
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a color value.
Using a color name without quotes or hash (#).
2fill in blank
medium

Complete the code to create a lighter shade of the base color using Sass's lighten function.

SASS
$light-color: lighten($base-color, [1]);
Drag options to blanks, or click blank then click option'
A10
B10%
C0.1
D100
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number without the % sign.
Using a decimal instead of a percentage.
3fill in blank
hard

Fix the error in the code to generate a color scale with 5 steps using a loop.

SASS
@for $i from 1 through 5 {
  $shade-[1]: lighten($base-color, $i * 10%);
}
Drag options to blanks, or click blank then click option'
A$i
B#i
Ci
Dindex
Attempts:
3 left
💡 Hint
Common Mistakes
Using the variable name without the $ sign.
Using an invalid variable name like #i.
4fill in blank
hard

Fill both blanks to create a map of color shades with keys from 1 to 5 and values as lighter colors.

SASS
$color-scale: (
  [1]: lighten($base-color, 10%),
  [2]: lighten($base-color, 20%)
);
Drag options to blanks, or click blank then click option'
A1
Blighten
C2
Ddarken
Attempts:
3 left
💡 Hint
Common Mistakes
Using function names as keys instead of numbers.
Using darken instead of lighten for lighter shades.
5fill in blank
hard

Fill all three blanks to generate a full color scale map with keys 1 to 3 and values as lighter shades increasing by 15%.

SASS
$full-scale: (
  [1]: lighten($base-color, 15%),
  [2]: lighten($base-color, 30%),
  [3]: lighten($base-color, 45%)
);
Drag options to blanks, or click blank then click option'
A1
B2
C3
D4
Attempts:
3 left
💡 Hint
Common Mistakes
Using keys that do not match the number of shades.
Using numbers outside the range 1 to 3.