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…
The clickable heading for a details disclosure widget. Provides the visible label that toggles the expanded content.
Description
The <summary> element must be the first child of a <details> element. It acts as the disclosure button that users click or tap to expand or collapse the details content.
Browsers render <summary> with a disclosure triangle by default. Vanilla Breeze replaces this with a custom chevron indicator that rotates on open, and ensures a touch-friendly 44px minimum height.
When to Use
Inside details: Always pair with <details> as its first child
Descriptive labels: Clear, concise text that describes what will be revealed
Question text: FAQ patterns with questions as summary content
Collapsible sections: Content sections that start closed (see the heading note below)
Important
The <summary> element is only valid as the first child of a <details> element. Using it elsewhere has no special behavior or semantics.
Headings Inside Summary
A summary is exposed as a button-like disclosure control, and its children are presentational. A heading placed inside it (<summary><h3>…</h3></summary>) loses its heading role: the text becomes the control's name, and heading navigation in a screen reader will not find it. If the section needs to appear in the heading outline, put the heading before the <details> (or around it, in a <section>) and keep the summary as a short label. Otherwise accept that the summary is a control, not a heading.
Heading outside the summary
<section><h3>Shipping</h3><details><summary>Delivery times and costs</summary><p>…</p></details></section>
Variants
Summary supports plain text, inline elements (bold, emphasis, code), and icons. Long text wraps naturally while the chevron remains aligned.
Basic details with summary
1234
<details><summary>Click this summary</summary><p>The summary element acts as the trigger for the details content.</p></details>
Summary with inline emphasis
1234
<details><summary><strong>Important:</strong> Read this carefully</summary><p>Inline elements work naturally inside summary.</p></details>
Summary with icon
123456789
<details><summary><layout-clusterdata-layout-gap="xs"><icon-wcname="info"size="sm"></icon-wc> Help and Information</layout-cluster></summary><p>Icons provide visual cues about the content type.</p></details>
CSS Reference
The summary element receives careful styling to ensure touch-friendly sizing, consistent chevron indicators, and clear keyboard focus.
summary {padding: var(--size-s) var(--size-m);cursor: pointer;font-weight: var(--font-weight-medium);list-style: none;display: flex;align-items: center;justify-content: space-between;gap: var(--size-s);/* Touch-friendly minimum height (44px) */min-block-size: var(--size-touch-min);/* Custom chevron indicator: a physical right+bottom corner, rotated to point toward the inline end (right in LTR, left in RTL) */ &::after {content: "";inline-size: 0.5em;block-size: 0.5em;border-right: var(--border-width-medium) solid currentColor;border-bottom: var(--border-width-medium) solid currentColor;transform: rotate(-45deg);transition: transform var(--duration-fast) var(--ease-default);flex-shrink: 0; } &::-webkit-details-marker { display: none; } &:focus-visible {outline: var(--border-width-medium) solid var(--color-interactive);outline-offset: calc(var(--border-width-medium) * -1); }}/* Right-to-left: closed chevron points left */summary:dir(rtl)::after {transform: rotate(135deg);}/* Rotate chevron when open (points down in both directions) */details[open] > summary::after {transform: rotate(45deg);}
Key Styling Features
Feature
Implementation
Purpose
Custom marker
::after pseudo-element
Consistent chevron across browsers
Touch target
min-block-size: var(--size-touch-min)
44px minimum for accessibility
Focus ring
:focus-visible
Keyboard navigation visibility
Animation
transition on transform
Smooth chevron rotation on open/close
Marker hiding
list-style: none + ::-webkit-details-marker
Cross-browser removal of native triangle
Context-Specific Overrides
Summary styling changes in different parent contexts:
Context
Indicator
Other Changes
nav.tree
+/− text indicator via ::before, with empty alt text (content: "+" / "") so the glyph is not read as part of the name
Smaller padding, no border. Hover highlights. Drops the 44px minimum (min-block-size: auto), about 37px tall: still above the 24px WCAG 2.2 AA target size, but below the 44px enhanced target.
accordion-wc
Own chevron (same shape), plus indicator variants
ARIA aria-controls added. Keyboard arrow navigation between summaries. Exclusive mode via the singleattribute.
tab-set
Chevron hidden (::after { display: none })
Summary becomes tab button. Active tab gets an accent bottom border.
NES and Windows 9x themes
Theme glyph via ::before (▶ or +/−) replaces the chevron; the core ::after is removed
Label starts at the inline start. The glyph has empty alt text, and the NES triangle mirrors under dir="rtl".
@media print
Hidden
Chevron and marker removed for clean printing.
Accessibility
Built-in Behavior
Acts as an implicit button — no role="button" needed
Keyboard accessible with Enter and Space keys
Screen readers announce expanded/collapsed state
Focus indicator provided via :focus-visible
Best Practices
Descriptive text: Write clear summaries that explain what content will be revealed
Avoid interactive children: Don't nest buttons, links, or other interactive elements inside summary
Single summary: Only one summary per details element
First child: Summary must be the first child of details
Decorative indicators: If you add a text glyph with ::before or ::after, give it empty alt text (content: "▶" / ""). Otherwise it is read as part of the summary's name
What to Avoid
Anti-patterns to avoid
12345678910111213
<!-- Bad: Interactive element inside summary --><details><summary> Settings<button>Reset</button><!-- Don't do this --></summary></details><!-- Bad: Summary not first child --><details><p>Some text</p><!-- Summary must come first --><summary>Label</summary></details>
Screen Reader Announcements
When focused, screen readers announce the summary text, that it's a disclosure control (button), and whether it is expanded or collapsed. Example: "Click this summary, button, collapsed"
Keyboard Support
Key
Action
Tab
Move focus to/from the summary element
Enter
Toggle the details open/closed
Space
Toggle the details open/closed
Related
<details> — The parent disclosure widget (required)
<accordion-wc> — Enhanced accordion with keyboard navigation between panels
<tab-set> — Tab interface where summary becomes the tab button
<nav> — Tree navigation uses summary as collapsible section headers
<dialog> — For modal overlays rather than inline disclosure
hidden — hidden="until-found" for collapsed content that find-in-page can reveal
Browser Support
The <summary> element is supported in all modern browsers. The ::marker pseudo-element has varying support for customization, which is why Vanilla Breeze uses ::after for the chevron indicator.