0
0
SASSmarkup~10 mins

Why architecture matters at scale in SASS - Test Your Understanding

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

Complete the code to define a variable for the primary color.

SASS
$primary-color: [1];
Drag options to blanks, or click blank then click option'
Acolor-primary
Bprimary-color
C#3498db
Dblue
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names as values instead of actual colors.
Forgetting the # in hex color codes.
2fill in blank
medium

Complete the code to create a mixin for a responsive container.

SASS
@mixin container { max-width: [1]; margin: 0 auto; padding: 0 1rem; }
Drag options to blanks, or click blank then click option'
A100vw
B50%
Cauto
D1200px
Attempts:
3 left
💡 Hint
Common Mistakes
Using 100vw which can cause horizontal scroll.
Using auto which does not limit width.
3fill in blank
hard

Fix the nested selector to add hover styles for links inside a nav.

SASS
nav {
  a {
    color: $primary-color;
    [1] {
      text-decoration: none;
    }
  }
}
Drag options to blanks, or click blank then click option'
A&
B&:hover
C&:link
D:hover
Attempts:
3 left
💡 Hint
Common Mistakes
Using :hover without &, resulting in invalid selector.
Using pseudo-classes at the wrong nesting level.
4fill in blank
hard

Fill both blanks to create a map of breakpoints and use it in a media query.

SASS
$breakpoints: (small: [1], large: [2]);

@media (min-width: map-get($breakpoints, small)) {
  body { font-size: 1rem; }
}
Drag options to blanks, or click blank then click option'
A480px
B768px
C1024px
D1200px
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up small and large breakpoint values.
Using invalid units or missing px.
5fill in blank
hard

Fill all three blanks to create a function that darkens a color by a percentage.

SASS
@function darken-color($color, $amount) {
  @return [1]($color, $amount * [2]);
}

$dark-primary: darken-color($primary-color, [3]);
Drag options to blanks, or click blank then click option'
Adarken
B0.01
C20
Dlighten
Attempts:
3 left
💡 Hint
Common Mistakes
Using lighten instead of darken.
Not converting the percentage number to decimal (multiply by 0.01).
Passing percentage as '20%' with % sign instead of number 20.