Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A major release: the default look changes (roadmap chunk 23's open question, dec
- Menus stay on screen: a popover holding a nav or a list (a user menu) opens next to the button that opened it, below it and flipping up or to the other side near an edge, with CSS anchor positioning (`position-area`, `position-try-fallbacks`), gated on `@supports (position-area: block-end)` so other browsers keep it centered (modern-web-guidance `viewport-aware-dropdowns`). Other popovers and the phone menu are unchanged.
- New-tab links: a link in running text with `target="_blank"` ends in " ↗", read as "(opens in a new tab)". Buttons, nav links, heading links, image links, and document links are left alone.
- Sticky top bar, opt-in: `<header data-layout="sticky">` stays at the top on the page background, the root gets `scroll-padding-top: 5rem` so a heading you jump to or a focused field doesn't land under it, and once it's stuck a soft shadow appears where `container-type: scroll-state` is supported (Chromium; elsewhere the hairline alone), following the modern-web-guidance `state-aware-sticky-headers` guide.
- Modal dialogs lock the page: while a `dialog:modal` is open the page behind doesn't scroll (`overflow: hidden` on the root via `:has()`), and the root keeps the scrollbar's space (`scrollbar-gutter: stable`), so nothing shifts sideways. Non-modal dialogs leave the page alone. Not in the scoped and Shadow DOM builds.
- Modal dialogs lock the page: while a `dialog:modal` is open the page behind doesn't scroll (`overflow: hidden` on the root via `:has()`), and the root keeps the scrollbar's space while it is open (`scrollbar-gutter: stable`), so a long page doesn't shift sideways. Non-modal dialogs leave the page alone. Not in the scoped and Shadow DOM builds.
- Disclosure: a `<details>` marker is a chevron instead of the browser's triangle, at the start of the summary and turning down when open, or at the end in an accordion (neighboring `<details>`, or a `name`) and turning up. Opening eases the height where `interpolate-size` and `::details-content` are supported (Chromium); elsewhere, and with reduced motion, it opens at once. The header-nav dropdown keeps its own chevron.
- Status banners: a `<p>`, `<div>`, `<section>` or `<aside>` with `role="status"` ("Saved") is an info-tinted banner and one with `role="alert"` ("Couldn't save") a red one; `data-tone` recolors either. Server-rendered or swapped in by htmx; nothing dismisses it. Empty live regions, inline ones, and regions TagAction adds are left alone.
- Required fields: in a form that also has optional fields, the label of a `required` field (a `<label>` right before it, or one wrapping it) ends in a red asterisk, hidden from screen readers. A form where every field is required, like a sign-in, shows none.
Expand Down Expand Up @@ -71,7 +71,7 @@ A major release: the default look changes (roadmap chunk 23's open question, dec
- The guide for AI agents is split so it can grow (roadmap chunk 24). `llms.txt` is now an index every agent reads: the rules and every pattern in one line, grouped by what you're building, each group linking to a detail file in `llms/` (pages, apps, forms, content, chat) with full examples and what each pattern leaves alone. `llms-full.txt` holds everything in one file. The Claude Code skill gets the detail files as references it reads on demand, Cursor gets one rule per topic, and `AGENTS.md` gets the full text. Tests check every snippet in every file, and that every pattern in a detail file is named in the index. The index is capped at 4,000 tokens (it's 3,038, down from 3,910 before the split), the full guide at 20,000 (it's 8,311).
- Coverage over size: the size ceiling is now 15 KB gzipped (it was 10 KB), and `llms.txt` is capped at 4,000 tokens, since agents read it on every page. See the guiding principle in `ROADMAP.md`.

**Changes to existing pages:** the page always keeps room for a scrollbar (`scrollbar-gutter: stable` on the root), so with classic scrollbars (Windows, Linux) a short page has an empty strip at the side; set `scrollbar-gutter: auto` on `:root` to undo it. Sections inside `<main data-layout="full">` used to get no side padding; they now get the page column's padding. Cards in an article grid are flex columns. Every `<dialog>` and `[popover]` now starts at `opacity: 0` and `scale: 0.97` until it's open, so a popover you show some other way than the popover API needs its own `opacity: 1`.
**Changes to existing pages:** Sections inside `<main data-layout="full">` used to get no side padding; they now get the page column's padding. Cards in an article grid are flex columns. Every `<dialog>` and `[popover]` now starts at `opacity: 0` and `scale: 0.97` until it's open, so a popover you show some other way than the popover API needs its own `opacity: 1`.

### Fixed
- Footer columns no longer bunch at the start and leave half the row empty: the navs sit at the end of the row, and a leading paragraph takes the space before them (up to 24rem wide). The footer is a wrapping flex row instead of a grid, so the columns wrap on phones.
Expand Down
14 changes: 6 additions & 8 deletions tagbrush.css
Original file line number Diff line number Diff line change
Expand Up @@ -1180,15 +1180,13 @@
box-shadow: none;
}
}
/* While a modal dialog is open the page behind it doesn't scroll, and the
scrollbar's space is always kept, so nothing shifts sideways when the
scrollbar goes away. Non-modal dialogs (show()) leave the page alone. */
:root {
scrollbar-gutter: stable;
}

/* While a modal dialog is open the page behind it doesn't scroll. The
scrollbar's space is kept only then, so a long page doesn't shift
sideways when its scrollbar goes away, and pages never carry an empty
strip the rest of the time. Non-modal dialogs (show()) leave the page alone. */
:root:has(dialog:modal) {
overflow: hidden;
scrollbar-gutter: stable;
}

/* A top bar that stays: <header data-layout="sticky"><nav>…</nav></header>.
Expand Down Expand Up @@ -1572,7 +1570,7 @@
with its top corners rounded, and it slides up instead of growing */
@media (max-width: 30rem) {
dialog:where(:modal) {
width: 100%;
width: 100vw; /* the whole screen, over the gutter kept for the page's scrollbar */
max-width: none;
max-height: 85dvh;
margin: auto 0 0;
Expand Down
2 changes: 1 addition & 1 deletion tagbrush.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tagbrush.scoped.css
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@
with its top corners rounded, and it slides up instead of growing */
@media (max-width: 30rem) {
dialog:where(:modal) {
width: 100%;
width: 100vw; /* the whole screen, over the gutter kept for the page's scrollbar */
max-width: none;
max-height: 85dvh;
margin: auto 0 0;
Expand Down
2 changes: 1 addition & 1 deletion tagbrush.scoped.min.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tagbrush.shadow.css
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
with its top corners rounded, and it slides up instead of growing */
@media (max-width: 30rem) {
dialog:where(:modal) {
width: 100%;
width: 100vw; /* the whole screen, over the gutter kept for the page's scrollbar */
max-width: none;
max-height: 85dvh;
margin: auto 0 0;
Expand Down
2 changes: 1 addition & 1 deletion tagbrush.shadow.min.css

Large diffs are not rendered by default.

18 changes: 15 additions & 3 deletions tests/tagbrush.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,17 @@ test.describe('semantic components', () => {
test('a modal dialog stops the page behind it from scrolling, without shifting it; a non-modal one does not', async ({ page }) => {
const width = () => page.evaluate(() => document.body.getBoundingClientRect().width);
const overflow = () => page.evaluate(() => getComputedStyle(document.documentElement).overflowY);
expect(await style(page, 'html', 'scrollbarGutter')).toBe('stable');
// No scrollbar space is reserved until a modal opens (no empty strip with classic scrollbars)
expect(await style(page, 'html', 'scrollbarGutter')).toBe('auto');
const before = await width();
// A painted classic scrollbar takes width; overlay scrollbars and headless runners take none
const bar = await page.evaluate(() => innerWidth - document.documentElement.clientWidth);
expect(await overflow()).toBe('visible');
await page.evaluate(() => document.querySelector('#demo-dialog').showModal());
expect(await overflow()).toBe('hidden');
expect(await width()).toBe(before);
expect(await style(page, 'html', 'scrollbarGutter')).toBe('stable');
// The page keeps the scrollbar's space, so it doesn't shift where a scrollbar was showing
if (bar > 0) expect(await width()).toBe(before);
await page.mouse.wheel(0, 600);
await page.waitForTimeout(100);
expect(await page.evaluate(() => scrollY)).toBe(0);
Expand All @@ -443,6 +448,7 @@ test.describe('semantic components', () => {
await page.setViewportSize({ width: 390, height: 800 });
await page.evaluate(() => document.querySelector('#demo-dialog').showModal());
let box = await page.locator('#demo-dialog').boundingBox();
// The whole screen width, over any gutter kept for the page's scrollbar
expect(Math.round(box.width)).toBe(390);
expect(Math.round(box.y + box.height)).toBe(800);
expect(await style(page, '#demo-dialog', 'borderBottomLeftRadius')).toBe('0px');
Expand Down Expand Up @@ -1033,6 +1039,11 @@ test.describe('content intent', () => {
test('readers who ask for more contrast get darker borders and full-contrast muted text', async ({ page }) => {
const before = await style(page, '#solo', 'borderTopColor');
await page.emulateMedia({ contrast: 'more' });
// Load the page again with the query already matching: Firefox under Playwright
// matches it in matchMedia without restyling a page that is already open
await page.reload();
const emulated = await page.evaluate(() => matchMedia('(prefers-contrast: more)').matches);
test.skip(!emulated, 'this browser does not emulate prefers-contrast, so the query never matches');
expect(await style(page, '#solo', 'borderTopColor')).not.toBe(before);
expect(await style(page, '#solo > small', 'color')).toBe(await token(page, 'var(--color-text)'));
});
Expand Down Expand Up @@ -1732,7 +1743,8 @@ test.describe('the 2.0 look', () => {
document.body.append(probe);
const value = getComputedStyle(probe).color;
probe.remove();
const match = value.match(/oklch\(([\d.]+) ([\d.]+)/);
// Firefox can print a near-zero chroma in exponent form (5.96046e-8)
const match = value.match(/oklch\(([\d.e+-]+) ([\d.e+-]+)/);
return match ? Number(match[2]) : 0;
}, name);
expect(chroma, `${scheme} ${name}`).toBeLessThanOrEqual(0.0121);
Expand Down
Loading