0
0
Tailwindmarkup~8 mins

Arbitrary properties for unsupported CSS in Tailwind - Performance & Optimization

Choose your learning style9 modes available
Performance: Arbitrary properties for unsupported CSS
MEDIUM IMPACT
This affects page load speed and rendering performance by adding custom CSS properties that may not be optimized by Tailwind's default build.
Adding custom CSS properties not supported by Tailwind's default classes
Tailwind
@layer utilities {
  .custom-blur {
    backdrop-filter: blur(10px);
  }
}

class="custom-blur"
Defining custom utilities in CSS reduces repetition and allows Tailwind to optimize styles better.
📈 Performance Gainreduces CSS size by 50% for repeated styles, single style recalculation
Adding custom CSS properties not supported by Tailwind's default classes
Tailwind
class="[backdrop-filter:blur(10px)] [unsupported-property:value]"
Using many arbitrary properties inline increases CSS size and complexity, causing slower style calculation and larger bundle size.
📉 Performance Costadds 5-10kb to CSS bundle per many arbitrary properties, triggers multiple style recalculations
Performance Comparison
PatternDOM OperationsReflowsPaint CostVerdict
Many inline arbitrary propertiesLowMultiple (if layout affected)High (complex styles)[X] Bad
Custom utility classes for propertiesLowSingle or noneLow[OK] Good
Rendering Pipeline
Arbitrary CSS properties are parsed during style calculation. Excessive or complex properties increase style calculation time and can trigger layout recalculations if they affect layout.
Style Calculation
Layout
Paint
⚠️ BottleneckStyle Calculation
Core Web Vital Affected
LCP
This affects page load speed and rendering performance by adding custom CSS properties that may not be optimized by Tailwind's default build.
Optimization Tips
1Limit the use of inline arbitrary CSS properties to reduce CSS size.
2Create custom utility classes for repeated unsupported CSS properties.
3Avoid complex or layout-affecting arbitrary properties inline to prevent multiple reflows.
Performance Quiz - 3 Questions
Test your performance knowledge
What is a main performance downside of using many arbitrary CSS properties inline in Tailwind?
AImproves browser caching automatically
BIncreases CSS bundle size and slows style calculation
CReduces paint time significantly
DEliminates layout shifts completely
DevTools: Performance
How to check: Record a performance profile while loading the page and interacting with elements using arbitrary properties. Look at the 'Style Recalculation' and 'Layout' events.
What to look for: Long style recalculation times or multiple layout shifts indicate performance issues with arbitrary properties.