Complete the code to define a variable in modern SASS.
$primary-color: [1];In modern SASS, variables start with a $ and are assigned values like colors directly. Here, #3498db is a valid color value.
Complete the code to use a variable inside a CSS rule in modern SASS.
button {
background-color: [1];
}var()To use a SASS variable inside a rule, you write the variable name with the dollar sign, like $primary-color.
Fix the error in this nested selector using modern SASS syntax.
nav {
ul {
margin: 0;
padding: 0;
list-style: none;
}
[1] {
display: block;
}
}li without &In modern SASS, to nest selectors that depend on the parent, use the ampersand &. Here, & li means nav li.
Fill both blanks to create a SASS map and access its value.
$colors: (primary: #3498db, secondary: #2ecc71); .button { color: map-get($colors, [1]); background-color: [2]; }
The map-get function retrieves the value for the key primary from the $colors map. The background color is then set to the color value #3498db.
Fill all three blanks to write a SASS function that darkens a color and use it.
@function [1]($color, $amount) { @return darken($color, $amount); } .alert { background-color: [2]; border-color: [3]; }
The function is named darken-color. The alert background uses the variable $primary-color. The border color uses the function call darken-color($primary-color, 10%) to darken the color by 10%.