Next.js inlineCss grew my HTML 7x
I tried inlineCss and a CSS split to fix render-blocking CSS on a static Next.js site. Both lost. The numbers, and what Next.js says about the trade-off.
· Updated · 4 min read

On my static Next.js 16 site, experimental.inlineCss grew the home page HTML from 17 KB to 117 KB gzipped, while removing a stylesheet of 31 KB. It was a net loss, so I turned it off. Splitting the stylesheet in two looked better on paper and broke the cascade on pages I had not touched.
This is the record of both attempts. The mobile Largest Contentful Paint on the home page is the headline text, and the headline waits for the stylesheet that blocks rendering. That is the problem I was trying to shrink.
Why a stylesheet delays the headline#
A stylesheet in the <head> blocks rendering until it arrives. web.dev's LCP guide says that if the stylesheet takes too long, it prevents the LCP element from rendering, even after the element's own resource has finished loading. The page can have the text in hand and still show a blank screen.
The same guide splits LCP into four parts and says the delay parts should be close to zero: roughly 40% of the time for the first byte, under 10% for resource load delay, roughly 40% for loading the resource and under 10% for render delay. For a text headline, "load the resource" is the HTML itself, so a render-blocking stylesheet shows up as render delay.
Its advice is to make the stylesheet smaller than the LCP resource, to inline only small stylesheets, and to remove unused CSS. LCP is good at 2.5 seconds or less and poor above 4.0, measured at the 75th percentile.
Attempt 1: inlineCss#
Next.js documents inlineCss as experimental. With it on, every place that would emit a <link> tag emits a <style> tag instead. The docs say to enable it if you use atomic CSS like Tailwind and care about first-load performance, and to skip it if returning visitors are common. They also list a known limitation: styles are duplicated during the initial load, once in the <style> tags and once in the RSC payload.
I use Tailwind 4, so I tried it. The home page HTML went from 17 KB to 117 KB gzipped. The render-blocking stylesheet it removed was 31 KB gzipped.
The duplication in the docs fits that jump, but I did not trace where the extra 100 KB went, so that is a guess.
There is a second reason it did not suit me. The docs say Tailwind keeps CSS compact because it emits only the classes you use. My site CSS totals 173 KB, and about 120 KB of it is Tailwind utilities, most of them used by the Lab experiments rather than the pages around them. The "compact" assumption did not hold.
I turned it off.
Attempt 2: two stylesheets#
If most of the CSS belongs to the experiments, the home page should not load it. I tried a site sheet and an experiments sheet.
On paper it saves about 11 KB gzipped on the home page, and the Lab example pages would load 11 KB more. I also judged that in the Lighthouse lab run the cost of the stylesheet is the extra request round trip, which a smaller file does not remove.
The real problem was correctness. Any utility class that exists in both sheets breaks the cascade, because the order of the two files decides which one wins. I saw md: variants lost and block beating flex. I only found it because I compared computed styles in the DOM across 44 pages before and after. Without that diff I would have shipped visible layout bugs on pages I never opened.
I dropped the split. 11 KB did not justify the risk.
What I did instead#
I stopped trying to shrink the stylesheet and moved work off the critical path:
- Hotjar and Google Tag Manager load on the first scroll, key press, click or touch, or after 7 seconds.
- The hero WebGL scene starts after load and idle.
- The home intro does not play on phones, so the headline is the LCP at once.
- Topic tiles use 480 px images instead of full-size ones.
On mobile the home page's Lighthouse score went from 48 to between 67 and 83 across that round of changes. I did not measure each change alone. A later change took the PageSpeed Insights mobile score from 54 to 90 by skipping the hero scene on software renderers, which I describe in Why a WebGL hero can tank PageSpeed. You can check which renderer your own browser uses with the WebGL Report.
What I would still try#
The stylesheet is 31 KB gzipped and still blocks rendering. The honest options left are splitting by route with a build step that never lets a class live in two sheets, or cutting the Tailwind utilities that only the experiments use at the source. I have not done either, because a mobile score of 90 in my last lab run does not justify a risky change.
What I did not measure#
The inlineCss numbers come from one build of this site. I did not capture a before and after for LCP itself, only for HTML and stylesheet size, so I cannot tell you how much a real visitor would have gained or lost. Your site, with a smaller stylesheet and fewer pages sharing it, may see the opposite result, and the Next.js docs are the place to check whether the flag is still experimental.