Performance: Namespace control with @use as
MEDIUM IMPACT
This affects CSS bundle size and style calculation by controlling how styles and variables are imported and referenced.
@use 'colors' as c; .button { color: c.$primary-color; }
@import 'colors'; @import 'colors'; .button { color: $primary-color; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| @import multiple times | N/A | N/A | Higher paint cost due to larger CSS | [X] Bad |
| @use with namespace alias | N/A | N/A | Lower paint cost due to smaller CSS | [OK] Good |