0
0
SASSmarkup

Null value behavior in SASS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does null represent in Sass?

In Sass, null means 'no value'. It is used to indicate that a variable or property has no value assigned.

Click to reveal answer
beginner
How does Sass treat a property with a null value when compiling CSS?

Sass skips any CSS property that has a null value. It does not output that property in the final CSS.

Click to reveal answer
intermediate
What happens when you use null in a Sass function or operation?

Using null in operations usually results in null. It acts like an empty or missing value, so calculations or concatenations with null often return null.

Click to reveal answer
intermediate
How can null be useful in conditional statements in Sass?

null can be used to check if a variable has no value. For example, you can write @if $var == null to run code only when the variable is empty.

Click to reveal answer
intermediate
What is the difference between null and an empty string "" in Sass?

null means no value at all, so Sass ignores it in output. An empty string "" is a value that is empty text, and Sass outputs it as an empty string in CSS.

Click to reveal answer
What does Sass do with a CSS property set to null?
AIt outputs the property with empty quotes
BIt removes the property from the output CSS
CIt throws an error
DIt outputs the property with value 'null'
Which of these is true about null in Sass?
A<code>null</code> is the same as an empty string
B<code>null</code> causes Sass to output 'null' text
C<code>null</code> means no value and is ignored in output
D<code>null</code> is a valid CSS color
What happens if you add a number to null in Sass?
AThe number is converted to a string
BThe number is returned
CAn error is thrown
DThe result is <code>null</code>
How can you check if a variable is null in Sass?
AUsing <code>@if $var == null</code>
BUsing <code>@if $var == ''</code>
CUsing <code>@if $var == 0</code>
DUsing <code>@if $var == false</code>
Which is NOT true about null in Sass?
A<code>null</code> is treated as an empty string in output
B<code>null</code> can be used in conditionals
C<code>null</code> can be used to remove CSS properties
D<code>null</code> means no value assigned
Explain how Sass handles null values when generating CSS and why this is useful.
Think about what happens if a property has no value.
You got /3 concepts.
    Describe how you can use null in Sass conditionals to control styles.
    Consider how to test if a variable is empty.
    You got /3 concepts.