Performance: Component-based file organization
This affects the CSS bundle size and load time by controlling how styles are split and loaded.
Jump into concepts and practice - no test required
// _buttons.scss .button { /* styles */ } // _header.scss .header { /* styles */ } // main.scss @import "buttons"; @import "header"; // Styles split by component
@import "reset"; @import "typography"; @import "buttons"; @import "header"; @import "footer"; // All styles in one big file
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Single large CSS file | N/A | N/A | High paint cost due to blocking | [X] Bad |
| Component-based CSS files | N/A | N/A | Lower paint cost, faster style calculation | [OK] Good |
@import 'reset';
@import 'header';
@import 'button';
body { font-family: Arial; }
.button { background: blue; }styles.scss importing partials:@import 'header';
@import 'footer';
body { margin: 0; }_footer.scss are not applied. What is the likely problem?