Data display

Typography

Styles for headings, paragraphs, lists, quotes, links and code inside one content wrapper.

Class nameTypeDescription
proseplf:proseComponentStyles the native content inside
prose-anchorplf:prose-anchorPartLink around a heading's text
prose-anchor-markplf:prose-anchor-markPartThe # shown on hover and focus
not-proseplf:not-proseBehaviorEnds the content styles inside it
prose-mark-primaryplf:prose-mark-primaryColorPrimary highlight on a mark
prose-mark-secondaryplf:prose-mark-secondaryColorSecondary highlight on a mark
prose-mark-successplf:prose-mark-successColorSuccess highlight on a mark
prose-mark-warningplf:prose-mark-warningColorWarning highlight on a mark
prose-mark-errorplf:prose-mark-errorColorError highlight on a mark
prose-mark-infoplf:prose-mark-infoColorInfo highlight on a mark
leadplf:leadModifierLarger, muted introductory paragraph

Wrap content that has no classes, such as a WordPress post, Markdown or CMS text, in prose, and its headings, paragraphs, lists, quotes, links and code get the library’s text styles. Build your own interface with components and utilities instead.

PHP
<article class="plf:prose"><?php the_content(); ?></article>

Build a useful rhythm

Keep paragraphs focused, and use headings to mark a new topic.

  • Keep each paragraph focused on one idea.
  • Use a list for genuinely parallel information.
  • Check long content in a narrow container.

Write for the person who needs to understand and act.

Review before sharing

Read the text aloud, then check that links describe their destinations.

Headings

Choose heading levels by meaning; the sizes follow the wrapper’s font size.

h1. Heading

h2. Heading

h3. Heading

h4. Heading

h5. Heading
h6. Heading

A larger introductory paragraph that sets up the page.

A regular paragraph follows the lead.

Muted, smaller supporting text.

Highlight the key detail while keeping the sentence readable.

Revision: Previous wording Updated wording.

Water: H2O. Area: m2.

Good typography makes the next sentence easy to find.

— Alex Morgan, Design notes

Put a quote’s attribution in a figcaption after the blockquote, inside a figure.

Highlight variants

Add one modifier to a mark; a mark without one stays amber.

Primary highlight.

Secondary highlight.

Success highlight.

Warning highlight.

Error highlight.

Info highlight.

Color alone does not carry meaning: use Badge for a status label and Alert for a message.

Wrap the heading text in prose-anchor with a hidden prose-anchor-mark; the # shows on hover and keyboard focus.

Set a theme

Each root chooses light, dark or auto.

Under a sticky header, headings with an id stop --plf-sticky-offset below the top (Sticky and skip links).

Embedded components

Wrap a component inside the content in not-prose, so it keeps its own typography. A nested data-plf-root is excluded on its own.

Written content can sit alongside a component.

Notification preferences

This card keeps its component typography.

Text after the card continues the same rhythm.

Text utilities

Text utilities work on any element, inside or outside prose. Utilities lists them all, including font sizes and weights.

Centered, semibold text.

Centered, muted text.

React

Prose from @pelatform/react renders the prose wrapper as a div; another element, such as an article, takes the class itself, as do lead, not-prose, the marks and the heading links.

Its props are a div’s own, className and ref included.

CSS variables

Set them on a root or a prose wrapper.

Variable Default
--plf-prose-font-size Body font size
--plf-prose-line-height Normal line-height
--plf-prose-block-gap Space before blocks and headings, between paragraphs in a quote and above a caption
--plf-prose-lead-size 1.25em
--plf-prose-h1-size … --plf-prose-h6-size 2.25em, 1.875em, 1.5em, 1.25em, 1.125em, 1em
--plf-prose-code-color Text color
--plf-prose-code-bg --plf-color-surface-muted
--plf-prose-mark-bg, --plf-prose-mark-color The highlight’s color pair; overrides every variant, so set both and check contrast

Built with Pelatform UIv0.1.0

Components

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons