Complete the code to define a variable for primary color in Sass.
$primary-color: [1];In Sass, variables start with $ and are assigned values like colors. Here, #3498db is a valid color value.
Complete the code to create a mixin that sets font size in Sass.
@mixin font-size-[1]($size) {
font-size: $size;
}Mixin names should be descriptive. font-size clearly indicates the mixin sets font size.
Fix the error in the conditional statement to check if $theme is dark.
@if $theme [1] 'dark' { background-color: black; }
In Sass, to compare values use ==. Single = is for assignment.
Fill both blanks to create a loop that generates margin classes from 1 to 3 rem.
@for $i [1] 1 [2] 3 { .m-#{$i} { margin: #{$i}rem; } }
to excludes the last numberuntil is invalid in SassThe @for loop syntax uses from and through to include the last number.
Fill all three blanks to create a map of colors and access the primary color.
$colors: ([1]: #ff0000, [2]: #00ff00, [3]: #0000ff); .primary { color: map-get($colors, [1]); }
Maps in Sass use keys like red, green, and blue. To get the primary color, use the red key.