Performance: Square bracket notation for custom values
This affects CSS bundle size and rendering speed by allowing custom values without extending the config, impacting initial load and style calculation.
class="bg-[#123456]"class="bg-[#1234567890abcdef]"| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Using many unique long custom values with square brackets | No extra DOM nodes | 0 reflows | High paint cost due to large CSS | [X] Bad |
| Using short custom values sparingly with square brackets | No extra DOM nodes | 0 reflows | Moderate paint cost | [!] OK |
| Using config-extended custom values instead of square brackets | No extra DOM nodes | 0 reflows | Low paint cost | [OK] Good |
mt-[10px] for margin-top 10 pixels.w- prefix for width utilities.250px is correct.class="w-[15rem]" in Tailwind CSS?w-[15rem] sets width to 15 rem units, where 1 rem equals the root font size (usually 16px).class="p-[20]" to add padding of 20 pixels, but it doesn't work. What is the error?20px, not just a number.bg- and border radius uses rounded-.#1a73e8 and the unit 12px for radius.Pass the test and this pattern moves unknown