$is-primary is set to true, so the @if condition is true.
Step 2: Determine which block runs
Since the condition is true, background-color: blue; is applied to button.
Final Answer:
Blue -> Option A
Quick Check:
@if true applies first block = Blue [OK]
Hint: True condition runs @if block [OK]
Common Mistakes:
Choosing else block color
Ignoring the variable value
Thinking no color applies
4. Identify the error in this Sass code snippet:
$font-size: 16px
body {
font-size: $font-size;
}
medium
A. Variable name should not start with $
B. Missing semicolon after variable declaration
C. font-size property is invalid
D. body selector is incorrect
Solution
Step 1: Check variable declaration syntax
In Sass, each statement must end with a semicolon; here it is missing after 16px.
Step 2: Verify other parts
Variable name and usage are correct; body selector is valid.
Final Answer:
Missing semicolon after variable declaration -> Option B
Quick Check:
Every Sass statement ends with ; [OK]
Hint: Always end Sass lines with semicolon [OK]
Common Mistakes:
Forgetting semicolon after variable
Removing $ from variable name
Misunderstanding CSS property syntax
5. You want to create a theme system in Sass that changes button colors based on a variable $theme. Which approach best uses logic to handle multiple themes?
hard
A. Use JavaScript to change button colors only
B. Set background color directly without conditions
C. Write separate CSS files for each theme without variables