In SASS, each statement must end with a semicolon. The variable declaration lacks a semicolon.
Step 2: Verify other parts
Variable names start with $, font-size is valid, and body selector is allowed.
Final Answer:
Missing semicolon after variable declaration -> Option B
Quick Check:
Semicolon missing after $font-size declaration = D [OK]
Hint: Always end variable declarations with semicolon [OK]
Common Mistakes:
Omitting semicolon after variable
Thinking $ is invalid for variables
Assuming selectors can't be used
5. You want to create a SASS stylesheet where all buttons have a background color stored in a variable, and on hover, the background becomes 15% lighter. Which SASS code correctly achieves this?
$btn-bg: #007bff;
button {
background-color: $btn-bg;
&:hover {
background-color: lighten($btn-bg, 15%);
}
} correctly declares $btn-bg with a semicolon and uses proper nesting with &:hover.
Step 2: Verify color function usage
$btn-bg: #007bff;
button {
background-color: $btn-bg;
&:hover {
background-color: lighten($btn-bg, 15%);
}
} uses lighten($btn-bg, 15%) to make the color lighter on hover, which matches the requirement.