Prose Content
Covers: raw HTML from markdown, CMS content, database content, blog posts, articles, documentation, and rendered markup where classes can't be applied to individual elements.
- Never use the
@tailwindcss/typographyplugin: instead create a.proseclass that styles raw HTML elements (headings, links, lists, code blocks, images, etc.) with plain CSS using Tailwind's CSS theme variables (var(--color-*),var(--text-*),var(--font-weight-*),var(--radius-*),--spacing(*),--alpha()); use@variant dark { … }and@variant hover { … }for dark mode and hover states; use* + *for vertical spacing between elements; style every element that could appear:h1,h6,p,a,ul,ol,li,pre,code,img,strong,blockquote - Apply the
.prosewrapper class to the container holding the rendered HTML:<div class="prose">around blog post content, markdown output, CMS-generated markup, or any HTML where you can't add Tailwind classes to individual elements - Default to
var(--text-base)(16px) for prose body text; usevar(--text-lg)(18px) or larger only if specifically requested or if the project already uses that size for body text elsewhere - Never set
max-widthin.proseCSS: constrain with amax-w-[*ch]class alongsideprose(e.g.<div class="prose max-w-[65ch]">); use60chto75ch, matched to the site's content widths. Go past75chonly for a documented reason such as a two-column layout or a code-heavy documentation page where wrapping costs more than measure, and raise leading toward1.75when you do - Set prose body
line-heightto1.6-1.75xthe font size: e.g.--spacing(7)forvar(--text-base). Go higher only past80ch, and constrain the measure before reaching for extra leading. - Use
text-prettyon blog post and article titles, nottext-balance - If the article
h1is sans-serif, use the same sans-serif for all subheadings (h2,h6); never mix a sans-serif title with serif subheadings