Performance: Importing built-in modules with @use
MEDIUM IMPACT
This affects the CSS build time and the final CSS size, impacting page load speed and render time.
@use "sass:math"; .selector { width: math.div(100%, 3); }
@import "sass:math"; .selector { width: math.div(100%, 3); }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| @import built-in module multiple times | N/A | N/A | Larger CSS causes slower paint | [X] Bad |
| @use built-in module once with namespace | N/A | N/A | Smaller CSS improves paint speed | [OK] Good |