Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to interpolate the variable $color inside the selector.
SASS
$color: red;
.[1]-text {
color: $color;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to use #{} for interpolation.
Placing the variable outside the selector name.
✗ Incorrect
The correct way to interpolate the variable inside the selector name is using
#{$color}-text.2fill in blank
mediumComplete the code to interpolate the variable $size inside the property name.
SASS
$size: large;
.button {
font-[1]: 2rem;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not using interpolation syntax.
Adding spaces between variable and text.
✗ Incorrect
To interpolate the variable inside the property name, use
font-weight-#{$size} syntax.3fill in blank
hardFix the error in the code by correctly interpolating the variable $state inside the selector.
SASS
$state: active;
.button-[1] {
background: blue;
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using
$state without interpolation.Using JavaScript style interpolation like
${state}.✗ Incorrect
The correct interpolation syntax in Sass is
#{$state} to insert the variable value.4fill in blank
hardFill both blanks to interpolate $prefix and $suffix inside the class name.
SASS
$prefix: btn; $suffix: primary; .[1]-[2] { padding: 1rem; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not interpolating one or both variables.
Using variables without the dollar sign.
✗ Incorrect
Both
$prefix and $suffix must be interpolated using #{} inside the selector.5fill in blank
hardFill all three blanks to interpolate $state, $color, and $size inside the selector and property.
SASS
$state: disabled; $color: gray; $size: small; .[1]-button { background-[2]: $[3]; }
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong interpolation syntax.
Mixing property names and variable names.
✗ Incorrect
The selector interpolates
$state with #{$state}, the property name is color, and the value uses the variable $color.