Symptom
Rendered MDX notes looked like one solid block: paragraphs with no air between them, even though the container carried prose prose-invert max-w-none. No build warning, nothing in the console.
Cause
@tailwindcss/typography is not installed in this project. Every prose in the markup is therefore a dead class: Tailwind generates nothing for it, and it goes unnoticed for a long time because there is no warning either.
In components/mdx/MDXContent.tsx, prose was pure decoration. What actually did the typography were the arbitrary variants next to it: [&_h2]:mt-12, [&_p]:leading-7 and so on.
And that is exactly where the spacing went missing. leading-7 sets line height, not margin, and Preflight had already reset the paragraph margin to zero. Rendered MDX paragraphs stick together until the page sets the spacing itself.
Check whether the plugin is there at all:
npm ls @tailwindcss/typography
Fix
Two ways, depending on whether you want to own the typography.
Install the plugin. In Tailwind 4 it is registered in the CSS file, no longer in a tailwind.config.js:
@import "tailwindcss";
@plugin "@tailwindcss/typography";
Or go without it, as this site does. Drop the dead prose classes and set the spacing explicitly. The container in MDXContent.tsx now sets, among others:
<div className="text-[17px] leading-[1.75] [&_p]:mb-6 [&_h2]:mt-14 [&_h2]:mb-4 [&_ul]:mb-6 [&_li]:mb-2">
The comment above it now says plainly that the plugin is missing and the body is styled there instead. Nobody trips over a class that does nothing anymore.
Tested with Tailwind 4.2 and Next.js 16.2.
See also
- The slug and the language live in the filename: how the MDX files get into the page in the first place.
- All notes
