Performance: Extracting critical CSS
HIGH IMPACT
This affects how fast the main content styles load and render, improving the page's initial paint speed.
/* Inline critical CSS for above-the-fold content */ <style>/* extracted minimal Tailwind CSS for visible content */</style> <link rel="stylesheet" href="tailwind.css" media="print" onload="this.media='all'">
@import 'tailwind.css'; /* full CSS loaded upfront */ <link rel="stylesheet" href="tailwind.css">
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Full Tailwind CSS loaded upfront | Minimal DOM impact | Triggers 1 reflow after full CSS load | High paint cost due to large CSS | [X] Bad |
| Inline critical CSS + deferred full CSS | Minimal DOM impact | Single reflow for critical styles | Lower paint cost, faster first paint | [OK] Good |