0
0
SASSmarkup~20 mins

Setting up SASS (npm, dart-sass) - Practice Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Sass Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of Dart Sass in a web project?
Dart Sass is a popular implementation of Sass. What does it mainly do in a web development workflow?
AIt automatically deploys Sass files to a live web server.
BIt runs JavaScript code inside Sass files to add interactivity to web pages.
CIt converts CSS files into Sass files for easier editing.
DIt compiles Sass (.scss) files into standard CSS files that browsers can understand.
Attempts:
2 left
💡 Hint
Think about what browsers understand and what Sass files need to become.
📝 Syntax
intermediate
2:00remaining
Which npm command correctly installs Dart Sass as a development dependency?
You want to add Dart Sass to your project using npm so you can compile Sass files. Which command should you run?
Anpm install dart-sass
Bnpm install sass --save-dev
Cnpm install sass --global
Dnpm install sass --save
Attempts:
2 left
💡 Hint
Think about the package name and how to add it only for development.
rendering
advanced
3:00remaining
What will be the output CSS after compiling this Sass code?
Given this Sass code, what CSS will Dart Sass produce?
SASS
$primary-color: #3498db;

.button {
  background-color: $primary-color;
  &:hover {
    background-color: darken($primary-color, 10%);
  }
}
A
.button {
  background-color: #3498db;
}
.button:hover {
  background-color: #2a80b9;
}
B
.button {
  background-color: $primary-color;
}
.button:hover {
  background-color: darken($primary-color, 10%);
}
C
.button {
  background-color: #3498db;
}
.button:hover {
  background-color: #3a9ce6;
}
D
.button {
  background-color: #3498db;
  &:hover {
    background-color: #2a80b9;
  }
}
Attempts:
2 left
💡 Hint
Remember Sass variables are replaced and functions like darken() calculate colors.
selector
advanced
2:30remaining
Which CSS selector is generated by this Sass nesting?
Given this Sass code, what is the correct CSS selector for the nested rule?
SASS
.nav {
  ul {
    margin: 0;
    li {
      list-style: none;
    }
  }
}
A.nav ul li { list-style: none; }
B.nav ul, li { list-style: none; }
C.nav ul li { margin: 0; }
Dul li { list-style: none; }
Attempts:
2 left
💡 Hint
Think about how nested selectors combine in Sass.
accessibility
expert
3:00remaining
How can you ensure your compiled CSS supports high contrast mode for accessibility?
You want your Sass styles to adapt when users enable high contrast mode in their operating system. Which CSS media feature should you use in your Sass code?
A@media (contrast-mode: high) { /* styles here */ }
B@media (high-contrast: true) { /* styles here */ }
C@media (prefers-contrast: more) { /* styles here */ }
D@media (accessibility: high) { /* styles here */ }
Attempts:
2 left
💡 Hint
Look for the official CSS media feature for contrast preferences.