0
0
SASSmarkup~20 mins

Token-driven color palettes in SASS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Token Palette Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate
2:00remaining
What is the output CSS color value?
Given the following Sass code using color tokens, what is the final CSS color value for .button background?
SASS
$color-primary: #3498db;
$color-secondary: #2ecc71;
$color-background: $color-primary;

.button {
  background-color: $color-background;
}
Abackground-color: #2ecc71;
Bbackground-color: #3498db;
Cbackground-color: $color-primary;
Dbackground-color: #000000;
Attempts:
2 left
💡 Hint
Remember that Sass variables are replaced with their values during compilation.
🧠 Conceptual
intermediate
1:30remaining
Which Sass feature helps create token-driven color palettes?
Which Sass feature is best suited to create reusable color tokens for a design system?
AVariables
BFunctions
CMixins
DPlaceholders
Attempts:
2 left
💡 Hint
Think about how you store fixed values like colors to reuse them.
selector
advanced
2:00remaining
Which selector applies the token-driven color correctly?
Given the Sass tokens below, which CSS selector applies the secondary color to all button elements inside a .card?
SASS
$color-secondary: #2ecc71;

.card {
  button {
    color: $color-secondary;
  }
}
A.card button { color: #2ecc71; }
Bbutton .card { color: #2ecc71; }
C.card > button { color: $color-secondary; }
Dbutton.card { color: #2ecc71; }
Attempts:
2 left
💡 Hint
Remember how nested selectors compile in Sass.
layout
advanced
2:30remaining
How to use token-driven colors with Flexbox layout?
You want to create a horizontal navigation bar with background color from a token. Which Sass code correctly applies the token and Flexbox layout?
SASS
$nav-bg: #1abc9c;

.navbar {
  display: flex;
  background-color: $nav-bg;
  justify-content: center;
}
A.navbar { display: grid; background-color: #1abc9c; justify-content: center; }
B.navbar { display: block; background-color: $nav-bg; justify-content: center; }
C.navbar { display: flex; background-color: #1abc9c; justify-content: center; }
D.navbar { display: flex; background-color: $nav-bg; justify-content: left; }
Attempts:
2 left
💡 Hint
Flexbox requires display:flex and the token variable must be replaced with its value.
accessibility
expert
3:00remaining
Which token-driven color choice improves accessibility for text contrast?
You have these Sass color tokens: $color-light: #f0f0f0; $color-dark: #222222; Which background and text color token pairing ensures good contrast for accessibility?
ABackground: $color-light; Text: $color-light
BBackground: $color-light; Text: $color-dark
CBackground: $color-dark; Text: $color-dark
DBackground: $color-dark; Text: $color-light
Attempts:
2 left
💡 Hint
High contrast means dark text on light background or vice versa.