Performance: Arbitrary properties for unsupported CSS
This affects page load speed and rendering performance by adding custom CSS properties that may not be optimized by Tailwind's default build.
@layer utilities {
.custom-blur {
backdrop-filter: blur(10px);
}
}
class="custom-blur"class="[backdrop-filter:blur(10px)] [unsupported-property:value]"| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Many inline arbitrary properties | Low | Multiple (if layout affected) | High (complex styles) | [X] Bad |
| Custom utility classes for properties | Low | Single or none | Low | [OK] Good |
scroll-margin-top to 2rem using Tailwind's arbitrary properties?[property:value].[scroll-margin-top:2rem].<div class="[border-radius:1rem] bg-blue-500 p-4 text-white">Hello</div>
[border-radius:1rem] sets border radius to 1rem. bg-blue-500 sets blue background. p-4 adds padding. text-white sets text color white.<div class="[padding-top=2rem] text-center">Content</div>
[padding-top:2rem].= which is invalid syntax.scroll-padding-left with value 3rem to a div using Tailwind. Which class should you use, and why might this be necessary?scroll-padding-left.[scroll-padding-left:3rem].Pass the test and this pattern moves unknown