Performance: Overriding color palette
MEDIUM IMPACT
This affects the CSS bundle size and rendering speed by changing how colors are loaded and applied in the browser.
module.exports = {
theme: {
colors: {
primary: '#1a202c',
secondary: '#2d3748',
accent: '#4a5568'
}
}
}module.exports = {
theme: {
extend: {
colors: {
primary: '#1a202c',
secondary: '#2d3748',
accent: '#4a5568',
// many custom colors added here
custom1: '#123456',
custom2: '#654321',
custom3: '#abcdef',
custom4: '#fedcba'
}
}
}
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Many custom colors in Tailwind config | Minimal | 0 | High due to large CSS | [X] Bad |
| Minimal color overrides in Tailwind config | Minimal | 0 | Low CSS paint cost | [OK] Good |