0
0
SASSmarkup~10 mins

Why migration to modern SASS matters - 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 in modern SASS.

SASS
$primary-color: [1];
Drag options to blanks, or click blank then click option'
A#3498db
Bprimary-color
Ccolor-primary
Dvar-primary
Attempts:
3 left
💡 Hint
Common Mistakes
Using variable names instead of color values
Missing the dollar sign in variable declaration
2fill in blank
medium

Complete the code to use a variable inside a CSS rule in modern SASS.

SASS
button {
  background-color: [1];
}
Drag options to blanks, or click blank then click option'
A$primary-color
Bprimary-color
Cvar(primary-color)
D#primary-color
Attempts:
3 left
💡 Hint
Common Mistakes
Using CSS variable syntax var()
Omitting the dollar sign
3fill in blank
hard

Fix the error in this nested selector using modern SASS syntax.

SASS
nav {
  ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }
  [1] {
    display: block;
  }
}
Drag options to blanks, or click blank then click option'
A.li
Bli
C& li
D#li
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain li without &
Using class or ID selectors incorrectly
4fill in blank
hard

Fill both blanks to create a SASS map and access its value.

SASS
$colors: (primary: #3498db, secondary: #2ecc71);

.button {
  color: map-get($colors, [1]);
  background-color: [2];
}
Drag options to blanks, or click blank then click option'
Aprimary
B#3498db
Csecondary
D#2ecc71
Attempts:
3 left
💡 Hint
Common Mistakes
Using color values instead of keys in map-get
Mixing keys and values incorrectly
5fill in blank
hard

Fill all three blanks to write a SASS function that darkens a color and use it.

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

.alert {
  background-color: [2];
  border-color: [3];
}
Drag options to blanks, or click blank then click option'
Adarken-color
B$primary-color
Cdarken-color($primary-color, 10%)
D$alert-border
Attempts:
3 left
💡 Hint
Common Mistakes
Not defining the function name
Using variables without dollar sign
Not calling the function correctly