Capítulo 5 de 108
shadcn/typeset is one owned CSS file that styles all rendered HTML/markdown (blog, docs, chat) inside a typeset container, controlled by three variables (size, leading, flow) instead of styling every element by hand.
typeset class: turns the styling on for its subtree; combine with a preset class (e.g. typeset-docs).--typeset-size (base font-size, default 1em), --typeset-leading (line-height), --typeset-flow (space between blocks) — everything else (heading sizes, list indent, rule spacing) derives from these.rem scale.not-typeset / data-not-typeset: opt a component and its subtree out of Typeset styling (equivalent to @tailwindcss/typography's not-prose).typeset-scroll: wrapper to make a wide table/block scroll horizontally instead of wrapping.:last-child, :has(), :empty) and only uses margin-block-start, so appending a new block never restyles earlier ones.@import "tailwindcss";
@import "./typeset.css";
<div className="typeset typeset-docs">
<YourMarkdownRenderer>{content}</YourMarkdownRenderer>
</div>
.typeset-chat {
--typeset-flow: 1em;
--typeset-leading: 1.6;
}
.typeset-docs {
--typeset-size: 15px;
--typeset-flow: 1.5em;
}
<div className="typeset">
<p>Styled prose.</p>
<Card className="not-typeset">Untouched component.</Card>
</div>
@tailwindcss/typography (prose) | Typeset | |
|---|---|---|
| Sizing | Fixed rem scale (prose-sm...prose-2xl) | Relative to container, any size |
| Dark mode | prose-invert, second palette | Theme tokens flip automatically |
| Theming | Prose color vars, scale baked in | App theme tokens + font/rhythm controls |
| Overrides | prose-a:, prose-headings: modifiers | Plain Tailwind utilities/CSS win (:where(), zero specificity) |
| Streaming | No append-stability contract | Designed for stable appends |
| Distribution | npm plugin, generated CSS | One CSS file you own |
max-width inside typeset.css: Typeset deliberately leaves measure/width to your layout (or the builder's "Measure" control on the wrapper), not baked into the stylesheet.:last-child/:has()-style rules when customizing: breaks streaming stability, causes earlier blocks to restyle as new ones arrive.typeset.css directly in the repo.!important, since it lives in the components layer with :where().