Complete the code to define a variable in SASS.
$primary-color: [1];In SASS, variables start with $ and store values like colors. Here, $primary-color is set to a hex color code.
Complete the code to nest CSS selectors in SASS.
nav {
ul {
[1]: none;
}
}Nesting selectors in SASS lets you write CSS inside CSS. Here, list-style: none; removes bullet points from the list inside nav.
Fix the error in the SASS mixin definition.
@mixin rounded-corners([1]) { border-radius: 5px; }
Mixin parameters in SASS must start with a dollar sign. Here, $radius is the correct parameter name.
Fill both blanks to create a SASS map and access its value.
$colors: (primary: [1], secondary: #2ecc71); .button { color: map-get($colors, [2]); }
The map $colors stores color values. We assign #3498db to primary and then get it with map-get($colors, primary).
Fill all three blanks to create a SASS function that darkens a color.
@function darken-color($color, $amount) {
@return [1]($color, [2]: $amount);
}
.button {
background-color: darken-color([3], 10%);
}lighten instead of darken.The darken function in SASS takes a color and an amount to darken it. We pass $primary-color and 10% to create a darker button background.