Performance: Null value behavior
MEDIUM IMPACT
How Sass handles null values affects CSS output size and conditional logic efficiency, impacting CSS bundle size and rendering speed.
$color: null; .selector { @if $color { color: $color; } }
$color: null; .selector { color: if($color != null, $color, black); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Output CSS with unnecessary properties due to null checks | N/A | N/A | Higher due to larger CSS | [X] Bad |
| Conditional Sass directives to skip null values | N/A | N/A | Lower due to smaller CSS | [OK] Good |