Challenge - 5 Problems
SASS Data Types Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Understanding SASS Data Types
Which of the following is NOT a valid data type in SASS?
Attempts:
2 left
💡 Hint
Think about the common SASS data types used for grouping values.
✗ Incorrect
SASS supports data types like List, Map, Color, Number, String, Boolean, and Null. Tuple is not a recognized data type in SASS.
📝 Syntax
intermediate2:00remaining
SASS Map Syntax
What is the correct way to define a map with keys 'primary' and 'secondary' and their color values in SASS?
Attempts:
2 left
💡 Hint
Maps use parentheses and colons for key-value pairs.
✗ Incorrect
In SASS, maps are defined using parentheses with key: value pairs separated by commas.
❓ rendering
advanced2:00remaining
Output of SASS List Interpolation
What will be the rendered CSS output of this SASS code?
$fonts: ('Arial', 'Helvetica', 'sans-serif');
body {
font-family: #{$fonts};
}SASS
$fonts: ('Arial', 'Helvetica', 'sans-serif'); body { font-family: #{$fonts}; }
Attempts:
2 left
💡 Hint
Interpolation converts the list to a comma-separated string without quotes.
✗ Incorrect
Using #{} interpolation on a list outputs the list items separated by commas without quotes in CSS.
❓ selector
advanced2:00remaining
SASS Selector Interpolation with Data Types
Given the variable
$state: active;, which selector will correctly compile to .btn-active in CSS?SASS
$state: active; .btn-#{$state} { color: blue; }
Attempts:
2 left
💡 Hint
Interpolation uses #{} to insert variable values into selectors.
✗ Incorrect
Option D uses correct interpolation syntax to insert the string value of $state into the selector.
❓ accessibility
expert3:00remaining
Using SASS Data Types to Improve Accessibility
How can SASS data types help improve accessibility in a website's color scheme?
Attempts:
2 left
💡 Hint
Think about grouping related colors for different accessibility modes.
✗ Incorrect
Using maps to group colors for normal and high-contrast modes allows developers to switch themes easily, improving accessibility.