0
0
SASSmarkup~5 mins

Number types and units in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What are the main number types used in Sass?
Sass mainly uses two number types: unitless numbers (like 5, 10) and numbers with units (like 5px, 2em, 50%).
Click to reveal answer
intermediate
How does Sass handle arithmetic with different units?
Sass can add, subtract, multiply, and divide numbers with units if the units are compatible. For example, you can add 10px + 5px, but not 10px + 5em without conversion.
Click to reveal answer
beginner
What happens if you multiply a number with a unit by a unitless number in Sass?
The unit stays the same. For example, 5px * 2 results in 10px. The unitless number scales the value but does not change the unit.
Click to reveal answer
beginner
Name some common CSS units that Sass supports.
Common units include px (pixels), em (relative to font size), rem (root font size), % (percentage), vh and vw (viewport height and width).
Click to reveal answer
intermediate
Can Sass convert between different units automatically?
No, Sass does not convert units automatically. You must manually convert units or use functions to handle unit conversions.
Click to reveal answer
Which of these is a unitless number in Sass?
A50%
B10px
C5em
D10
What is the result of 5px * 3 in Sass?
A15px
B5px3
C8px
D15
Can you add 10px + 5em directly in Sass?
ANo, units must be compatible
BYes, always
CYes, but only in SCSS syntax
DOnly if you use a special function
Which unit represents a percentage in Sass?
Apx
B%
Cem
Drem
Does Sass automatically convert 1in to 96px?
AYes
BOnly in SCSS
CNo
DOnly with a plugin
Explain the difference between unitless numbers and numbers with units in Sass.
Think about how Sass treats plain numbers versus numbers with px, em, %.
You got /4 concepts.
    Describe how Sass handles arithmetic operations involving units.
    Consider what happens when you add 10px + 5px versus 10px + 5em.
    You got /4 concepts.