Challenge - 5 Problems
Token Palette Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
📝 Syntax
intermediate2: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; }
Attempts:
2 left
💡 Hint
Remember that Sass variables are replaced with their values during compilation.
✗ Incorrect
The variable $color-background is assigned the value of $color-primary, which is #3498db. So the background-color becomes #3498db in the compiled CSS.
🧠 Conceptual
intermediate1: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?
Attempts:
2 left
💡 Hint
Think about how you store fixed values like colors to reuse them.
✗ Incorrect
Variables store fixed values like colors and can be reused throughout the stylesheet, making them ideal for token-driven palettes.
❓ selector
advanced2: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; } }
Attempts:
2 left
💡 Hint
Remember how nested selectors compile in Sass.
✗ Incorrect
The nested Sass selector compiles to '.card button' which applies the color to all button elements inside .card.
❓ layout
advanced2: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; }
Attempts:
2 left
💡 Hint
Flexbox requires display:flex and the token variable must be replaced with its value.
✗ Incorrect
Option C correctly sets display:flex, uses the token value #1abc9c for background-color, and centers content with justify-content:center.
❓ accessibility
expert3: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?
Attempts:
2 left
💡 Hint
High contrast means dark text on light background or vice versa.
✗ Incorrect
Option D uses a dark background with light text, which provides strong contrast and better readability for accessibility.