Complete the code to define a color token variable for primary color.
$primary-color: [1];The correct way to define a color token variable is to assign a valid color value like #3498db to the variable.
Complete the code to use the primary color token in a CSS rule.
button {
background-color: [1];
}To use a Sass variable, prefix it with $. The variable name is $primary-color.
Fix the error in the token usage to apply a lighter shade of the primary color.
button {
background-color: lighten([1], 20%);
}The lighten() function requires a valid color variable with the $ prefix. So $primary-color is correct.
Fill both blanks to create a token-driven palette map with primary and secondary colors.
$color-palette: ( primary: [1], secondary: [2] );
The palette map uses the primary color variable $primary-color and a direct hex value #2ecc71 for secondary color.
Fill all three blanks to create a function that returns a color from the palette by token name.
@function get-color($token) {
@return map-get([1], [2]);
}
$color: get-color([3]);The function uses map-get on $color-palette with the key $token. The call passes primary as the token name.