Repository navigation
Drop five Leaf words authors can write as HTML or CSS: data-room, Copy's mark, ol.steps, .eyebrow and the header search - #6148
Merged
Merged
Conversation
…text with a grid stack `data-room` let a page reserve a label's width from newline-separated representative strings. No real page has used it since it went in, and `page-layout.md`, "Space for changing text", already teaches the plain CSS for the same job just above it: the text states stacked in one grid cell, which also reserves their wrapped height. So the registry idiom, its arms in `controls.css`, its paragraphs in `page-layout.md`, the module-authoring line and the "lf- twin" clause in `browser/AGENTS.md` go. Leaf's own `data-lf-room`, which the runtime and packages write on their controls, stays unchanged. Tests: `test_authored_label_room_keeps_toolbar_still_before_runtime` protected the page-facing idiom and is deleted; on the grid recipe it would test only the browser's grid. The portable host in `test_plain_page.py` no longer carries a `data-room` span, since the attribute is no longer a name Leaf might style. The feature gallery's "Changing text keeps its space" scenario showed only the idiom and is dropped with its script. Authors lose nothing a page used: a status that changes words holds its room with the documented grid stack. > _This was written by Claude Code on behalf of max-sixty_
`block-controls.js` set `data-lf-control-active` on a block while its chrome control (Copy, mostly) was hovered or focused, so page CSS could add `:has([data-lf-control-active])` to a hover reveal and keep, say, a card's actions showing while the reader was on Copy, which stands in chrome outside the block's tree. No Leaf rule reads the mark and no real page used it. The mark, the hover and focus tracking that fed it, the `page-authoring.md` paragraph that taught it, and its two browser tests (`test_code_copy_keeps_its_source_container_active` and its touch twin) go. What changes: a page card that reveals its own actions on hover hides them while the pointer or focus is on a code block's Copy control. > _This was written by Claude Code on behalf of max-sixty_
The reading theme's `ol.steps` cleared a numbered list's top margin and put 10px between its items. Six of the 208 pages real sessions worked on used it. A procedure is an `<ol>`, which the theme already sets with native numbers, so the registry entry and its six CSS lines go, and every example, example version, docs page, the README demo and the indented-holders test fixture write a plain `<ol>`. What changes: those lists' items sit about 4px closer, and the list keeps the theme's usual top margin. > _This was written by Claude Code on behalf of max-sixty_
…op the .eyebrow class HTML already writes a heading's label: an `<hgroup>` holds paragraphs either side of one heading, so a `<p>` that starts the group stands before it. Of 198 eyebrows on the pages real sessions worked on, 137 were a `p.eyebrow` in exactly that place, and 137 of the 138 paragraphs standing there were eyebrows. So the reading theme now keys its eyebrow look on `hgroup > p:first-child` and drops the class: the small uppercase label, its 10px gap to the heading, and the heading level's top margin moved onto the group (`hgroup:has(> p:first-child + h2)`). A subtitle after the heading keeps the body's face. The rules end at the group or at a heading's place in it rather than at the old `.eyebrow + :is(h1, h2, h3)`, a sibling combinator over every heading that `notes/browser-support.md` measured as one of the rules that make Firefox restyle a whole long page on an insertion. The registry's `.eyebrow` entry becomes an `hgroup` entry saying what the theme does with the group. Every example, example version, docs page, test fixture, the corpus and README demo pages and the eval drafts write `<hgroup><p>…</p><hN>…</hN></hgroup>`. In `lf-pane` headers, whose `> header > hN` rule draws the pane's name as a label, the eyebrow stays a bare paragraph beside the heading rather than wrapping it. The corpus no longer cuts a page's opening eyebrow: it keyed on the class, and since #3167 a tab's label is the page's title, not its eyebrow. The `grouped-title-address/status-label` eval rubric now asks for the paragraph in the title's hgroup instead of the class. What changes for authors: an eyebrow written anywhere but first in an hgroup, such as a paragraph before a heading in a `<header>` (18 on real pages) or a label over a paragraph (the feature gallery's thread title pair), is a plain paragraph. Runtime tests that used the class incidentally keep their markup without it. > _This was written by Claude Code on behalf of max-sixty_
… scroll-margin-top Since #5389, `root-headers.js` hit-tested the window's top on every document layout, resize and scroll end to find a header the page fixed or stuck there, and wrote how far down it reached as `--lf-page-head`. `base.css` added that to the sticky-header slot (`--lf-top`) for everything in `body`, so a landing cleared the header, Leaf's sticky boxes stuck below it, and a block's Copy, a heading's link and a margin pin scrolled under it passed under it. One of the 208 pages real sessions worked on has such a header, and CSS already states the one thing a page needs: `scroll-margin-top`, which `page-layout.md` said replaces Leaf's room. The detection goes: `readPageHead`, `pageHeads`, the `data-lf-page-head` mark and its rules, `--lf-page-head` in the slot, the call from the document layout, the exported `restandControls` the reading triggered (a resize still restands Copy), the heads threaded through margin seating, and the `elementsFromPoint` stub the Node tests kept for it. `registerRootHeader` stays in `root-headers.js` for the tab strip and `lf-dial`. A pin on the words of a header fixed in the window still reads the room in that header (`stillBox`, `inWindow`). Leaf's root `scroll-padding-top` stays `!important`. `page-layout.md` now tells authors to give every element with an id a `scroll-margin-top` a little taller than such a header, and `module-scroll-and-motion.md` drops the paragraph promising packages a slot below the page's heads. `test_page_head.py` keeps the fixed header beside `main`: its pin keeps one seat, and a link lands by the page's own `scroll-margin-top`, once. Its sticky-header case and the subtests of detection (Copy, sticky boxes and what counts as on screen under the header) go. What changes on a page with its own fixed or sticky header: a link or walk lands under it unless the page sets `scroll-margin-top`; Leaf's pins, Copy and sticky strips draw over it rather than passing under it; and a sticky header's pin can seat differently by where the page was scrolled when the margin was laid out. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
previously approved these changes
Nov 16, 2026
…e hgroup tag Keyed on hgroup, the entry made hgroup a tag a bundled package declares, so the kernel's own reading of hgroup titles (addressable-names.js) failed test_kernel_selectors_name_no_package_tag. The entry describes the opening paragraph's look, so it takes that selector.
leaf-agent
approved these changes
Nov 16, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 21, 2026
The build moved `.tag`, `.lede`, `dl.facts` and `svg.drawing` from the reading theme to the default package behind `--lf-reading-face`. A review found that the gate keeps those rules out of markup a shadow-tree widget holds, so the facts in a worktree card lost their layout, and main has since rewritten the rules it moved (#6148, #6289). The build stays at ab039c4.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Five places where Leaf asked authors to learn its own word for something HTML or CSS already says, each removed in its own commit:
data-room(page-facing): authors reserve room for changing text with the CSS grid stackpage-layout.mdalready documents. Leaf's owndata-lf-roomstays. No real page used it.data-lf-control-active: the mark a code block wore while its Copy control was hovered, for page CSS to add:has(…). No Leaf rule and no real page read it. A page card that reveals actions on hover now hides them while the reader is on Copy.ol.steps: a numbered list is<ol>. Plain-text steps sit about 4 px closer..eyebrow: the reading theme styles the<p>that opens an<hgroup>(hgroup > p:first-child), HTML's place for a heading's tagline; 137 of 198 eyebrows on real pages were already written that way. An eyebrow outside an hgroup, such as one in a<header>, is now a plain paragraph. The old.eyebrow + h…sibling rule, one cause of Firefox restyling long pages, goes with it.root-headers.jsdetection,--lf-page-head): a page with its own sticky header gives its targetsscroll-margin-top, aspage-layout.mdnow shows. Without it, a link lands under that header (probed: 22 px instead of 94 px below a 71 px header), and Leaf's pins and sticky strips pass over the header rather than under it.registerRootHeaderstays for the tab strip andlf-dial; the rootscroll-padding-topstays!important.Source −314 lines net, tests −286; examples grow by 110 as eyebrows gain their
<hgroup>. Not scored: the registry's eyebrow entry now describes the hgroup look, thegrouped-title-address/status-labeleval rubric asks for the hgroup paragraph instead of the class, andpage-layout.mdgains thescroll-margin-toprecipe.Max picked these on a survey of places Leaf puts its own layer between authors and HTML. Tests:
pnpm run check, the model and browser tests the changes reach by node id, andleaf-dev stills --base --authoredon five examples (0 px changed).