Complete the code to define a variable for the primary color.
$primary-color: [1];The variable $primary-color should be assigned a valid color value like #3498db. This allows consistent use of the primary color throughout the styles.
Complete the code to create a mixin for a responsive container.
@mixin container { max-width: [1]; margin: 0 auto; padding: 0 1rem; }The max-width of a container is often set to a fixed pixel value like 1200px to limit content width on large screens while centering it.
Fix the nested selector to add hover styles for links inside a nav.
nav {
a {
color: $primary-color;
[1] {
text-decoration: none;
}
}
}:hover without &, resulting in invalid selector.To target the hover state on links inside nav, nest &:hover inside the a selector. This compiles to nav a:hover { text-decoration: none; }.
Fill both blanks to create a map of breakpoints and use it in a media query.
$breakpoints: (small: [1], large: [2]); @media (min-width: map-get($breakpoints, small)) { body { font-size: 1rem; } }
The map defines breakpoints for responsive design. small is often around 480px and large around 1200px. The media query uses the small breakpoint.
Fill all three blanks to create a function that darkens a color by a percentage.
@function darken-color($color, $amount) {
@return [1]($color, $amount * [2]);
}
$dark-primary: darken-color($primary-color, [3]);lighten instead of darken.The darken function in Sass darkens a color by a percentage (decimal). Multiplying $amount (20) by 0.01 converts it to a decimal (0.2). Calling with 20 darkens by 20 percent.