Performance: Configuration file structure
MEDIUM IMPACT
This affects the build time and final CSS bundle size by controlling which styles are generated and included.
module.exports = {
theme: {
extend: {
colors: {
primary: '#1da1f2',
secondary: '#14171a'
}
}
},
variants: {},
plugins: []
}module.exports = {
theme: {
extend: {
colors: {
primary: '#1da1f2',
secondary: '#14171a',
accent: '#657786',
extra1: '#aab8c2',
extra2: '#e1e8ed',
extra3: '#f5f8fa',
// many unused colors
}
}
},
variants: {},
plugins: []
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Large config with many unused colors | No direct DOM impact | No reflows | High paint cost due to large CSS | [X] Bad |
| Minimal config with only needed colors | No direct DOM impact | No reflows | Low paint cost with small CSS | [OK] Good |