Prose
Long-form text in a 65-character measure on shadcn's tokens: headings, lists, quotes, tables, code and images, light and dark.
Native .astro · no React · MIT · free, no account
The reading room opens at nine on weekdays and at ten on Saturdays. Bring a pencil: pens stay in the lockers by the door.
Ordering items
Order up to five boxes a day in the online catalogue. They arrive at your desk within forty minutes.
Photographs
Phones are fine without flash. For prints, ask at the desk.
const opening = { weekdays: "09:00", saturday: "10:00" };Getting here
Five minutes from the central station, by the canal.
Install
npx shadcn@latest add https://www.themes.dev/astro/r/prose.jsonThe CLI needs a components.json (from npx shadcn init), which also writes the tokens these files use. No CLI? Copy the files below to the same paths.
Files
---// Long-form text (a post body, a legal page) in the site's type: wrap rendered Markdown or <PortableText> in it.// The styles are styles/prose.css, built on shadcn's tokens, so they follow dark mode. Import that file once in your// global CSS: @import './prose.css';interface Props { class?: string;}--- <div class:list={['kit-prose', Astro.props.class]}><slot /></div>/* Long-form text for <Prose>: a 65-character measure, 18px body, headings on the type scale, and every colour from shadcn's tokens (--foreground, --muted-foreground, --border, --muted, --card), so dark mode needs nothing extra. */@layer components { .kit-prose { max-width: 65ch; font-size: 1.125rem; line-height: 1.65; color: var(--foreground); } .kit-prose > * + * { margin-top: 1.25em; } .kit-prose :where(h2) { margin-top: 2.25em; font-size: 1.875rem; line-height: 1.08; letter-spacing: -0.018em; font-weight: 600; scroll-margin-top: 6rem; } .kit-prose :where(h3) { margin-top: 1.75em; font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; font-weight: 600; scroll-margin-top: 6rem; } .kit-prose :where(h2, h3) + * { margin-top: 0.75em; } .kit-prose :where(a) { text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; } .kit-prose :where(a:hover) { text-decoration-thickness: 2px; } .kit-prose :where(strong) { font-weight: 600; } .kit-prose :where(ul, ol) { padding-left: 1.4em; } .kit-prose :where(ul) { list-style: disc; } .kit-prose :where(ol) { list-style: decimal; } .kit-prose :where(li + li) { margin-top: 0.4em; } .kit-prose :where(li)::marker { color: var(--muted-foreground); } .kit-prose :where(blockquote) { border-left: 2px solid var(--border); padding-left: 1.25em; font-size: 1.25rem; line-height: 1.5; } .kit-prose :where(:not(pre) > code) { border-radius: calc(var(--radius) - 4px); background: var(--muted); padding: 0.15em 0.35em; font-size: 0.875em; } .kit-prose :where(pre) { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 1rem 1.25rem; font-size: 0.875rem; line-height: 1.7; } .kit-prose :where(hr) { border: 0; border-top: 1px solid var(--border); margin: 2.5em 0; } .kit-prose :where(table) { width: 100%; border-collapse: collapse; font-size: 1rem; } .kit-prose :where(th, td) { border-bottom: 1px solid var(--border); padding: 0.6em 0.75em; text-align: left; vertical-align: top; } .kit-prose :where(th) { font-weight: 600; } .kit-prose :where(figure) { margin-top: 2em; margin-bottom: 2em; } .kit-prose :where(img) { border-radius: var(--radius); } .kit-prose :where(figcaption) { margin-top: 0.75em; font-size: 0.875rem; color: var(--muted-foreground); }}More for content
- FigureFreeAn image with a caption. Width, height and alt are required, so the page never jumps; local images go through astro:assets.Figure.astro
- Code blockFreeCode highlighted at build time with Shiki, light and dark, with a file name and a copy button.CodeBlock.astro
- Portable TextFreeSanity's Portable Text as HTML through astro-portabletext, with headings that carry ids, links, images and code blocks.PortableText.astro · Heading.astro · Link.astro · Image.astro · Code.astro