Performance: Arbitrary color values
This affects CSS parsing and rendering speed because arbitrary values bypass Tailwind's predefined classes and generate unique utility classes.
Jump into concepts and practice - no test required
<div class="bg-blue-600 text-blue-200 border border-blue-400"></div><div class="bg-[#123456] text-[#abcdef] border border-[#fedcba]"></div>| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using many arbitrary color values | No extra DOM nodes | Minimal reflows | Higher paint cost due to complex styles | [X] Bad |
| Using Tailwind predefined colors | No extra DOM nodes | Minimal reflows | Lower paint cost with cached styles | [OK] Good |
bg-[#ff5733]bg-[#ff5733], you can use any valid CSS color.bg-[...] is correct.rgba(255,0,0,0.5) is valid CSS and correctly placed inside brackets.text-[hsl(120,100%,50%)]bg-[#12345G]bg- are correct here.dark: prefix to apply styles in dark mode.