Vanilla Breeze v0.7.4

Vanilla Breeze v0.7.4 released

0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…

Read the release notes

p

The paragraph element represents a block of text, forming the basic building block of written content on the web.

Overview

The <p> element is used for blocks of text content. It automatically creates vertical spacing between adjacent paragraphs and uses modern CSS text-wrap features for optimal readability.

When to Use

  • Body text — For regular prose and explanatory content
  • Descriptions — Product descriptions, summaries, introductions
  • Lead paragraphs — Opening text that introduces a section
  • Form help text — Explanatory text near form controls

When Not to Use

  • For single words or phrases (use <span> instead)
  • For items in a sequence (use <ul> or <ol>)
  • For code snippets (use <code> or <pre>)
  • For quoted text (use <blockquote>)

Lead Paragraph

Use the .lead class to create an introductory paragraph with larger, muted text. Commonly used as the opening paragraph of an article or section.

Balanced Text

The .balance class applies text-wrap: balance, which distributes text evenly across lines. Ideal for short, centered text like hero subtitles or card descriptions.

Note: Browsers limit text-wrap: balance to roughly 6 lines of text. For longer paragraphs, the default text-wrap: pretty is more appropriate.

Indented Paragraphs

The .indent class adds a book-style first-line indent. When consecutive indented paragraphs follow each other, the inter-paragraph margin collapses to zero, creating traditional prose formatting.

In Chinese, Japanese and Korean text (:lang(zh), :lang(ja), :lang(ko)) the indent is exactly one full-width character (1em), following the CJK convention. p.lead in those languages keeps the CJK body leading of 1.8 instead of the Latin --line-height-relaxed.

Drop Cap

Add data-drop-cap to a single paragraph to give it a large decorative initial letter. It uses initial-letter: 3 where supported, with a floated fallback. To put the drop cap on an article's opening paragraph automatically, set data-drop-cap on the <article> instead — see the article page.

The enlarged letter is decorative: screen readers still read the word as written.

Justified Text

The .justify class aligns text to both edges and enables automatic hyphenation. This produces the polished look seen in books and newspapers. Works best in narrow columns (40-60ch).

Language required: hyphens: auto only hyphenates when the paragraph (or an ancestor, usually <html>) has a lang attribute the browser has a hyphenation dictionary for. Without it the text is justified but not hyphenated, so expect wider word gaps.

Accessibility note: The a11y-dyslexia theme automatically overrides p.justify to left-aligned text with no hyphenation, ensuring readability for users with dyslexia.

Text Emphasis

Paragraphs can contain inline elements for emphasis and semantic meaning.

Choosing the Right Element

Element Meaning Screen readers (default settings)
<strong> Importance, seriousness, urgency Conveys semantics; most screen readers do not announce it by default
<b> Stylistic bold (keywords, product names) Not announced
<em> Stress emphasis Conveys semantics; most screen readers do not announce it by default
<i> Alternative voice (terms, thoughts) Not announced
<small> Side comments, fine print Normal reading
<mark> Highlighted for reference Some readers announce it, often only with verbose settings

Never rely on emphasis alone to carry meaning that matters (a warning, a required step): with default settings, most screen readers read <strong> and <em> in the normal voice. Put the meaning in the words.

Nested Emphasis

Italic inside an italic context toggles back to upright (the classic emphasis toggle), so <em> inside <em>, a <blockquote>, <cite>, <dfn> or <var> still shows a difference. Nested <strong><em> renders as true bold-italic.

CSS Properties

The paragraph rules from src/native-elements/paragraph/styles.css (the same file also styles strong, b, em, i, small and mark — see each element's page). The CJK lead leading lives in src/native-elements/i18n/styles.css; the drop cap in src/native-elements/article/styles.css.

Variant Summary

Class Purpose
p.lead Larger, muted intro paragraph
p.balance Even line distribution for short, centered text
p.indent Book-style first-line indent with collapsed margins
p.justify Justified alignment with auto-hyphenation (needs lang)
p[data-drop-cap] Large decorative initial letter

Accessibility

Best Practices

  • Semantic structure — Use paragraphs for actual paragraph content, not for layout spacing
  • Reading level — Write at an appropriate reading level for your audience
  • Line length — Keep lines to 45-75 characters for optimal readability
  • Contrast — Ensure sufficient color contrast with the background

Screen Reader Behavior

Screen readers treat each paragraph as a separate block of content. In browse mode, most screen readers let users move between paragraphs with a keyboard command (for example, P in NVDA and JAWS). Paragraph styling such as .lead, .indent or data-drop-cap is visual only and is not announced.

Dyslexia Theme

The a11y-dyslexia theme overrides p.justify to use left-aligned text and disables hyphenation. The .lead, .balance, and .indent classes remain unaffected since they don't interfere with readability.

↑