0
0
SASSmarkup~20 mins

Why migration to modern SASS matters - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Modern SASS Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Why use the new @use rule instead of @import in SASS?
What is the main benefit of using @use instead of @import in modern SASS?
AIt automatically scopes variables and mixins to avoid conflicts.
BIt allows importing CSS files only, not SASS files.
CIt disables nesting of selectors for better readability.
DIt removes the need to compile SASS to CSS.
Attempts:
2 left
💡 Hint
Think about how variables and mixins behave when imported multiple times.
📝 Syntax
intermediate
2:00remaining
Identify the error in this modern SASS code snippet
What error will this SASS code produce when compiled?
$color: blue;
@use 'colors';
.button {
  color: $color;
  background: colors.$background;
}
SASS
$color: blue;
@use 'colors';
.button {
  color: $color;
  background: colors.$background;
}
ANo error, code compiles and outputs correct CSS.
BError: Undefined variable $background because it needs to be accessed as colors.background without $.
CError: Cannot use @use after variable declaration.
DError: Variables cannot be used inside selectors.
Attempts:
2 left
💡 Hint
Check how variables are accessed from a module imported with @use.
rendering
advanced
2:00remaining
What CSS output results from this modern SASS code?
Given this SASS code using @use and variables, what is the rendered CSS?
@use 'sass:color';
$primary: #3498db;
.button {
  background-color: $primary;
  color: color.scale($primary, $lightness: -40%);
}
SASS
@use 'sass:color';
$primary: #3498db;
.button {
  background-color: $primary;
  color: color.scale($primary, $lightness: -40%);
}
A
.button {
  background-color: #3498db;
  color: #1f5a7a;
}
B
.button {
  background-color: #3498db;
  color: #5dade2;
}
C
.button {
  background-color: #3498db;
  color: #000000;
}
DSyntaxError: color.scale requires a color variable, not a hex code.
Attempts:
2 left
💡 Hint
The color.scale function adjusts lightness by percentage.
selector
advanced
2:00remaining
Which selector will correctly style nested elements in modern SASS?
In modern SASS, which option correctly styles a <nav> element's <a> links inside a .menu class using nesting?
SASS
.menu {
  /* style links here */
}
A
.menu {
  &amp; &gt; a {
    color: blue;
  }
}
B
.menu {
  &amp; a {
    color: blue;
  }
}
C
.menu {
  a {
    color: blue;
  }
}
D
.menu {
  .a {
    color: blue;
  }
}
Attempts:
2 left
💡 Hint
Think about how nesting works for child elements inside a class.
accessibility
expert
3:00remaining
How does migrating to modern SASS improve accessibility in web projects?
Which of the following best explains how modern SASS features help improve accessibility in CSS styling?
ABy converting all colors to grayscale to improve contrast.
BBy automatically adding ARIA attributes to HTML elements during compilation.
CBy disabling all animations by default to prevent motion sickness.
DBy enabling modular styles with <code>@use</code>, it reduces CSS conflicts that can break focus outlines and ARIA styles.
Attempts:
2 left
💡 Hint
Think about how better CSS organization affects accessibility features.