0
0
SASSmarkup~20 mins

Why data types matter in SASS - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
SASS Data Types Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding SASS Data Types
Which of the following is NOT a valid data type in SASS?
ATuple
BMap
CList
DColor
Attempts:
2 left
💡 Hint
Think about the common SASS data types used for grouping values.
📝 Syntax
intermediate
2:00remaining
SASS Map Syntax
What is the correct way to define a map with keys 'primary' and 'secondary' and their color values in SASS?
A$colors: (primary: #ff0000, secondary: #00ff00);
B$colors: [primary: #ff0000, secondary: #00ff00];
C$colors: {primary: #ff0000, secondary: #00ff00};
D$colors: primary => #ff0000, secondary => #00ff00;
Attempts:
2 left
💡 Hint
Maps use parentheses and colons for key-value pairs.
rendering
advanced
2: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};
}
A
body {
  font-family: 'Arial', 'Helvetica', 'sans-serif';
}
B
body {
  font-family: Arial, Helvetica, sans-serif;
}
C
body {
  font-family: ('Arial', 'Helvetica', 'sans-serif');
}
D
body {
  font-family: Arial Helvetica sans-serif;
}
Attempts:
2 left
💡 Hint
Interpolation converts the list to a comma-separated string without quotes.
selector
advanced
2: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;
}
A.btn-#{$state} { color: blue; } /* but $state is a list */
B.btn-{$state} { color: blue; }
C.btn-#{$state.toString()} { color: blue; }
D.btn-#{$state} { color: blue; }
Attempts:
2 left
💡 Hint
Interpolation uses #{} to insert variable values into selectors.
accessibility
expert
3:00remaining
Using SASS Data Types to Improve Accessibility
How can SASS data types help improve accessibility in a website's color scheme?
ABy using lists to store font sizes only, unrelated to colors or accessibility.
BBy using strings to hardcode color values directly in CSS properties without variables.
CBy using maps to store color pairs for normal and high-contrast modes, allowing easy theme switching.
DBy using numbers only for margins and paddings, ignoring colors.
Attempts:
2 left
💡 Hint
Think about grouping related colors for different accessibility modes.