0
0
SASSmarkup~10 mins

@each loop over lists in SASS - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to loop over the list and print each color.

SASS
@each $color in [1] {
  color: $color;
}
Drag options to blanks, or click blank then click option'
Acolor-list
B$colors
Ccolors
D$color-list
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting the $ before the list variable.
Using a variable name that does not exist.
2fill in blank
medium

Complete the code to loop over the list $sizes and set font-size.

SASS
@each $size in [1] {
  font-size: $size;
}
Drag options to blanks, or click blank then click option'
A$sizes
Bsizes
C$size
D$fontsize
Attempts:
3 left
💡 Hint
Common Mistakes
Using the loop variable instead of the list variable in the loop.
Omitting the $ in the list variable.
3fill in blank
hard

Fix the error in the loop to correctly iterate over $fonts.

SASS
@each $font in [1] {
  font-family: $font;
}
Drag options to blanks, or click blank then click option'
Afonts
B$font
C$fonts
Dfont
Attempts:
3 left
💡 Hint
Common Mistakes
Using the singular form instead of the plural list variable.
Omitting the $ in the list variable.
4fill in blank
hard

Fill both blanks to loop over $shapes and set border-radius.

SASS
@each [1] in [2] {
  border-radius: $shape;
}
Drag options to blanks, or click blank then click option'
A$shape
Bshapes
C$shapes
D$radius
Attempts:
3 left
💡 Hint
Common Mistakes
Using the list variable without $.
Using the wrong variable names.
5fill in blank
hard

Fill all three blanks to loop over $borders and set border styles.

SASS
@each [1] in [2] {
  border-style: [3];
}
Drag options to blanks, or click blank then click option'
A$border
B$borders
Dborder
Attempts:
3 left
💡 Hint
Common Mistakes
Using the list variable without $.
Omitting the $ when using the loop variable inside the property value.