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…
Interactive glossary wrapper with live search filtering and scroll-spy letter tracking; copyable term permalinks are optional.
Overview
The <glossary-index> component wraps a static <dl>-based glossary to add live search filtering and scroll-spy active letter tracking. A glossary is mostly linked to: a term in prose links to its entry here, and the entry it lands on is highlighted. Without JavaScript, the glossary is fully readable with anchor link jump navigation.
Basic usage
1234567891011121314151617181920212223242526
<glossary-index><navclass="glossary-jump"aria-label="Jump to letter"><ahref="#A">A</a><ahref="#B">B</a><ahref="#C">C</a></nav><sectionclass="glossary-section"id="A"><h2>A</h2><dl><dt><dfn>Accessibility</dfn></dt><dd>The practice of making websites usable by everyone.</dd><dt><dfn>ARIA</dfn></dt><dd>Accessible Rich Internet Applications specification.</dd></dl></section><sectionclass="glossary-section"id="B"><h2>B</h2><dl><dt><dfn>Breadcrumb</dfn></dt><dd>A navigation pattern showing the user's location.</dd></dl></section></glossary-index>
<!-- Each letter section follows this pattern --><sectionclass="glossary-section"id="P"><h2>P</h2><dl><dt><dfn>Progressive Enhancement</dfn></dt><dd>A strategy that starts with baseline content and layers on functionality.</dd></dl></section>
Required Classes
Class
Element
Purpose
.glossary-jump
nav
Letter jump navigation bar
.glossary-section
section
Container for each letter group (must have an id matching the letter)
Content Elements
Element
Purpose
dl
Definition list containing terms and descriptions
dt
Term container
dfn
The defined term (used as the search target)
dd
Term definition
Behavior
Search filtering: A search input (in a <search> landmark) is injected at the top of an inner <main>, otherwise just before the .glossary-jump nav, otherwise after the first heading. Typing filters terms in real time, hiding non-matching terms and emptied sections. A visible message appears when nothing matches.
Term groups: Filtering walks real <dl> groups — several <dt> sharing one <dd>, several <dd> for one term, or <div>-wrapped groups — and hides or shows each group as a whole.
Scroll-spy: As the user scrolls, the active letter in the jump navigation gets aria-current="true" (styled bold in the interactive colour). The current letter is the last section whose top has passed a third of the way down the viewport, so the first letter is current at the top of the page however short its section is.
Arriving at a term: A link to a term’s id (from prose, or a related term) highlights the term and its definition as one tinted block with an accent on its leading edge, clear of a sticky header.
Permalinks (optional): With the permalinksattribute, every <dt> with an id gets a # link, shown on hover or focus. Activating it goes to the term (focus, history, :target) and copies the term’s URL to the clipboard. Jump links and permalinks stay on the page under <base href>.
Deep links: URL hash is updated when clicking jump links, allowing direct links to specific letters.
Progressive enhancement: Without JavaScript, the static markup provides a fully functional glossary with working anchor links.
Accessibility
Jump navigation uses aria-label="Jump to letter" for screen reader context
Active letter in jump navigation is marked with aria-current="true"
Search input has an accessible name from data-label-filter; the placeholder is only a hint
A polite status announces the match count while filtering, and the full count when the filter is cleared
Filtered-out sections are hidden with display: none, removing them from the accessibility tree; jump links to them are aria-disabled until the filter changes
Permalinks are named “Copy link to term”, are at least 24×24 px, show on hover, keyboard focus and always on touch devices, and announce when the link is copied
Uses semantic <dl>, <dt>, <dd>, and <dfn> elements
Keyboard accessible — tab through jump links and search input