If you write utility classes, you do not write your stylesheet. A compiler does, from the class names it finds in your source, and the file it produces is the thing browsers actually have to deal with. I had read plenty about Tailwind 4 and never once opened the output.

So I opened ours. The subject is Nakodo: two CSS files, served from the live site, generated from one 865-line source file plus whatever classes appear across 582 TypeScript files.

How it was measured

Every page links the same two stylesheets, which you can see for yourself in the head of any page. Fetch both, strip comments, then walk the braces by hand rather than with a regular expression, because the file is one line and nested at-rules make anything else guesswork:

6,159 bytes + 148,219 bytes = 154,378 bytes 

Inside, five cascade layers in this order, with these sizes:

Layer Bytes
properties 2,286
theme 5,495
base 4,691
components 612
utilities 110,377

Plus roughly 25 KB that is in no layer at all. 71% of the shipped CSS is the utilities layer, which is the bargain: you get a long file of single-purpose rules and you never write a selector.

1,818 selectors and no ids

1,638 rule blocks carry 1,818 selectors, 1,604 of them distinct. Only 135 of the blocks have more than one selector in the list.

Computing specificity by hand needs a caveat up front: :where() contributes nothing by specification, and :is() takes the specificity of its most specific argument, so a naive counter gets Tailwind's variant selectors wrong in both directions. What I can state without ambiguity is the shape, by counting class-like components in each selector:

Class-like components Selectors Share
1 1,123 61.8%
2 268 14.7%
0 149 8.2%
3 87 4.8%
4 36 2.0%
5 13 0.7%
6 3 0.2%

Zero selectors contain an id. Not one, in 154 KB. 1,037 of the 1,818 are a bare single class and nothing else, which is the canonical utility shape:

.flex{display:flex} 

67 selectors are a bare element name, five are the universal selector, nine involve :root, and 39 use a pseudo-element. The median selector is 13 characters long.

The longest is 276 characters:

.sm\:group-data-\[size\=default\]\/alert-dialog-content\:group-has-data-\[slot\= alert-dialog-media\]\:col-start-2:is(:where(.group\/alert-dialog-content) [data-size=default] *):is(...) 

That is one class name I wrote in a component file, compiled. The class name is the selector, escaped, and then the conditions are appended as :is(:where(...)) wrappers. Which brings me to the actual mechanism.

205 :where(), 183 :is(), 37 :has()

The modern utility framework's hardest problem is that variants have to nest without specificity fighting. hover:, sm:, group-data-[state=open]: all need to apply at the same weight as the base utility, or the order of your classes would start to matter.

The answer is :where(), which always contributes zero, and :is(), which contributes its most specific argument. The generated CSS uses :where() 205 times, :is() 183 times, :has() 37 times and :not() 77 times. Every ancestor condition in a variant is wrapped so that the selector still weighs what the single class weighed. The whole system of "later class in the file wins" depends on that, and it is implemented in two pseudo-classes that have only been safe to use for about three years.

900 of the 1,818 selectors contain a backslash escape. That is the other half of the trick: sm:col-start-2 is a legal class attribute value and an illegal CSS selector, so every colon, bracket, slash and equals sign in a class name gets escaped on the way out. If you have ever wondered why a Tailwind stylesheet is unreadable, that is why, and it is not avoidable.

436 attribute selectors, all of them data-*

Attribute Selectors
data-state 48
data-side 47
data-size 29
data-active 24
data-orientation 23
data-variant 22
data-slot 20
data-checked 18
data-open 18
data-closed 14

Not one attribute selector targets an HTML attribute. They are all component state, published as data-* by the component library and read back by generated variant selectors. This is what replaced the old .btn.is-active convention: the state lives on the element as data, the styling reads it with an attribute selector, and nothing has to invent a class name.

Most of those 436 selectors never match anything on a public page, because the components they belong to live behind the login. The public pages use 540 of the 1,739 class selectors in this file, and the rest ship because the stylesheet is one file for the whole app.

87 @property registrations

@property is the largest at-rule population in the file, ahead of @supports at 67, @media at 42, @keyframes at 28 and @font-face at 20. 79 of the 87 are --tw-* names I never typed:

@property --tw-enter-opacity{syntax:"*";inherits:false} @property --tw-animation-duration{syntax:"*";inherits:false} 

78 of the 87 declare syntax:"*", which means untyped, and 86 declare inherits:false. Registering an untyped non-inheriting custom property is not about animation or type checking, it is about making the property behave like a real one: it gets a defined initial value, it stops inheriting into children that should not see it, and an unset value falls back predictably instead of resolving to an empty string.

Eight of the 87 are ours, and they split into two features: --scroll-fade-t, -b, -s, -e and -mask for fading the edge of a scrollable pane, and --shimmer-angle, --shimmer-image and --shimmer-text-fill for the loading placeholders. Exactly one @property in the entire file declares inherits:true, and it is ours:

@property --shimmer-angle{syntax:"<angle>";inherits:true;initial-value:20deg} 

That one has to inherit, because the angle is set once on a container and every shimmering child needs to read the same value. It is the only place in 154 KB where inheritance is the point, and finding it in the output is a cleaner explanation of what @property is for than anything I had read.

The nine !important

Here they are, all of them:

Count Selector Who wrote it
1 [hidden]:where(:not([hidden=until-found])) the framework's preflight
3 *,:before,:after inside prefers-reduced-motion:reduce me, in the source CSS
1 .\!font-sans me, as !font-sans in a class name
2 .\!shadow-popover me, as !shadow-popover in a class name
2 .\[\&\>svg\]\:size-3\!>svg me, as [&>svg]:size-3! in a class name

The first is correct and unavoidable: [hidden] has to beat display:flex on the same element or the attribute would be a suggestion.

The second is the reduced-motion override, where !important is the accepted idiom because the rule has to win over whatever animation a component declared inline.

The last three are the interesting ones, because they are a single character in a class name. Two of them are in one file:

toast: "cn-toast !shadow-popover !font-sans", 

That is a third-party toast component being overridden, and the ! prefix is how you force a utility past a library's own styles. The third is [&>svg]:size-3! in a badge component, sizing an icon inside a slot. All five are the same situation: somebody else's CSS is in the cascade and I do not control its order.

Five !important declarations across a 72,000-line codebase, all five of them at a boundary with code I did not write, is a number I am happy with. It also means that if the count ever moves, the new one is worth reading, which is a cheap test to write and I have not written it.

A few other numbers from the output

  • 2,935 declarations across 493 distinct property names. The commonest are background-color (123), transform (101), width (97) and height (90).
  • 666 of the declarations, 23%, declare a custom property rather than a CSS property. var(-- appears 1,549 times and calc( 516 times.
  • 183 hex colours, in a stylesheet whose source contains none. Every colour in our source is oklch(), and the compiler writes an sRGB hex fallback plus the wide-gamut value guarded behind @supports (color:lab(0% 0 0)). So --color-cyano-800 ships as #004783 and as lab(29.0577% .0230372 -39.9201), and which one your browser uses depends on what it can parse.
  • 115 color-mix() values, 56 of which mix in oklab, which is the modern opacity modifier doing its work.

What I take from this

  1. Zero ids and five of my own !important is a result, and the only reason I know it is that I read the output. No tool told me. Nothing enforces either number. Both are one assertion over a fetched stylesheet, and both are worth having, because the day either one changes is a day something happened.
  2. @property with inherits:false is the feature I had misunderstood. I assumed it existed for transitions. 86 of the 87 registrations in this file exist to stop a custom property leaking into children, which is a correctness tool, not an animation one.
  3. The 1,199 unused class selectors are a one-file decision, not waste. 69% of this stylesheet styles pages behind a login. Splitting it would buy a public visitor about 100 KB uncompressed and cost every signed-in navigation a second stylesheet. I have decided not to, and now I have the number behind the decision.
  4. Read your output after a major version bump. Everything structural in this file, the layers, the :where() wrappers, the @property registrations, the lab fallbacks, arrived with Tailwind 4 and Lightning CSS. None of it is in my source. If you upgraded and did not look, you are shipping a file with a different architecture than the one you think you have.

Both stylesheets are public: open any page on nakodo.app, read the two <link rel="stylesheet"> URLs out of the head, and fetch them. The query I would run first on your own output is the id one. It takes a second and the answer should be zero.