Challenge - 5 Problems
Sass Setup Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2: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?
Attempts:
2 left
💡 Hint
Think about what browsers understand and what Sass files need to become.
✗ Incorrect
Dart Sass takes Sass files, which have special syntax, and turns them into normal CSS files that browsers can read and apply styles from.
📝 Syntax
intermediate2: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?
Attempts:
2 left
💡 Hint
Think about the package name and how to add it only for development.
✗ Incorrect
The official Dart Sass package on npm is named 'sass'. Using --save-dev adds it as a development dependency, which is best practice for build tools.
❓ rendering
advanced3: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%); } }
Attempts:
2 left
💡 Hint
Remember Sass variables are replaced and functions like darken() calculate colors.
✗ Incorrect
Dart Sass replaces variables with their values and evaluates functions like darken(). The hover selector is nested and compiled to .button:hover with the darkened color.
❓ selector
advanced2: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; } } }
Attempts:
2 left
💡 Hint
Think about how nested selectors combine in Sass.
✗ Incorrect
Sass nesting combines selectors by placing child selectors after parent selectors. So li inside ul inside .nav becomes .nav ul li.
❓ accessibility
expert3: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?
Attempts:
2 left
💡 Hint
Look for the official CSS media feature for contrast preferences.
✗ Incorrect
The standard CSS media feature to detect user preference for higher contrast is prefers-contrast with values like 'more' or 'less'.