Skip to content

Dropdowns, tabs, theme switch, copy/share, matching fields, search results - #1

Merged
evangress merged 1 commit into
mainfrom
more-behaviors
Nov 11, 2026
Merged

evangress merged 1 commit into
mainfrom
more-behaviors

Conversation

@evangress

Copy link
Copy Markdown
Contributor

Behaviors for the patterns TagBrush.css gained (kovirlabs/tagbrush#44–#47) and things visitors expect on any site. Everything keys off native elements, ARIA, or data-tag-*, and every page still works with JavaScript off.

HTML Behavior
<li><details><summary>…</summary><ul>…</ul></details></li> in the page header's nav dropdown: Escape, click outside, or a chosen link closes it; arrow keys move through it. Other <details> are left alone
a link to an id inside a closed <details> opens it, on load and on hashchange (FAQ deep links)
<div popover> holding links closes when a link is followed (phone menus)
role="tablist" + role="tab" buttons with aria-controls shows the selected panel, labels panels, arrow keys / Home / End. All panels show without JS
<select data-tag-theme> or <button data-tag-theme> light/dark switch, remembered, sets data-theme on <html>
<button commandfor="x" command="--copy"> copies a field's value or an element's text
<button commandfor="x" command="--share"> share sheet for a section's link or an <a>; copies the link where there's no share sheet
<input data-tag-match="password"> invalid ("Doesn't match Password.") until it matches; the form's messages show it
a list a filter box controls, written hidden search results: shown only while something is typed, with just the matches

Size

8.8 KB gzipped (was 7.6 KB). The ceiling goes from 8 KB to 15 KB, the same coverage-over-size change TagBrush.css made, with the size reported in each release.

Not included

Live password-rule checklists (they'd need new syntax; native validation messages cover the essentials) and showing a thank-you message after a background form submit (fetch-and-swap, left to htmx by the family spec).

Follow-ups

  • TagBrush.css has no tab styles yet; a TagBrush PR adds them.
  • TagKit's MkDocs theme can use the search-results list for search by page title.
  • The family spec (Spec.md §5.2) lists v1 behaviors; these extend it.

Checks

New fixture tests/fixtures/extras.html with tests for each behavior and the elements it must leave alone. The no-JavaScript test allows the new JS-only controls and results lists to carry hidden; the llms.txt contract test renders every new snippet. Chromium 63 passed, WebKit 58 passed (5 Chromium-only skipped); Firefox can't launch locally, so CI is its first run.

🤖 Generated with Claude Code

…sults

Behaviors for the patterns TagBrush.css gained, and things visitors
expect on any site, all from plain HTML:

- A <details> dropdown in the header nav closes on Escape, a click
  outside, or a chosen link; arrow keys move through it.
- A link into a closed <details> (an FAQ answer) opens it.
- A popover of links (a phone menu) closes when one is followed.
- Tabs: role="tablist"/"tab" with aria-controls panels, arrow keys,
  Home, End. Every panel shows without JavaScript.
- Theme switch: <select data-tag-theme> or <button data-tag-theme>,
  remembered, setting data-theme on <html>.
- command="--copy" and command="--share".
- data-tag-match keeps a confirm field invalid until it matches.
- A filter box's list written `hidden` is search results: shown only
  while something is typed.

The size ceiling goes from 8 KB to 15 KB gzipped (now 8.8 KB):
coverage over bytes, as for TagBrush.css.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@evangress
evangress merged commit a8ad6e6 into main Nov 11, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant