0
0
SASSmarkup~10 mins

Multi-brand stylesheet 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 variable for the primary color.

SASS
$primary-color: [1];
Drag options to blanks, or click blank then click option'
Acolor-primary
B#ff5733
Cprimary-color
Dcolor
Attempts:
3 left
💡 Hint
Common Mistakes
Using a variable name instead of a color value.
Omitting the # in the hex color.
2fill in blank
medium

Complete the mixin to accept a brand name parameter.

SASS
@mixin brand-colors($[1]) { color: map-get($colors, $[1]); }
Drag options to blanks, or click blank then click option'
Atheme
Bcolor
Cname
Dbrand
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated parameter names like $color or $theme.
Forgetting the $ sign before the parameter.
3fill in blank
hard

Fix the error in the map-get function to retrieve the brand color.

SASS
$brand-color: map-get($colors, [1]);
Drag options to blanks, or click blank then click option'
A$brand
B$brand-color
Cbrand
Dcolors
Attempts:
3 left
💡 Hint
Common Mistakes
Using the color variable instead of the brand key.
Using a string without $ sign.
4fill in blank
hard

Fill both blanks to create a map of brand colors and use it in a class.

SASS
$colors: ([1]: #3498db, [2]: #e74c3c);

.brand-[1] { color: map-get($colors, [1]); }
Drag options to blanks, or click blank then click option'
Ablue
Bred
Cgreen
Dyellow
Attempts:
3 left
💡 Hint
Common Mistakes
Using color names not matching the map keys.
Mismatching class name and map key.
5fill in blank
hard

Fill all three blanks to generate brand-specific background and text colors.

SASS
@mixin brand-style($[1]) {
  background-color: map-get($colors, $[2]);
  color: map-get($text-colors, $[3]);
}
Drag options to blanks, or click blank then click option'
Abrand
Dcolor
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names for each blank.
Using unrelated variable names like $color.