Skip to content

Name Leaf's stylesheets by where they rank, and give the default package its own chips - #4653

Merged
max-sixty merged 8 commits into
mainfrom
leaf-out-of-the-way
Oct 29, 2026
Merged

max-sixty merged 8 commits into
mainfrom
leaf-out-of-the-way

Conversation

@max-sixty

@max-sixty max-sixty commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Leaf's stylesheets are now named for where they rank, and the default package draws its own chips, so a page with no theme keeps them. A follow-up to #4637, which made the reading look an optional theme and left "theme" naming three different things.

Names

  • Package sheets: widgets.css becomes defaults.css (in lf-base, below Layouts) and theme.css becomes overrides.css, in the tier lf-theme renamed lf-overrides (above Layouts). Each sheet keeps its tier and order, so no page computes a different style. The bundled packages, docs/package, package init's scaffold, the composer, schema.PACKAGE_STYLES, packages.md, package-themes.md, docs/extending.html, the tests and the native-package-scopes eval prompt follow. A package still shipping the old names contributes nothing (AGENTS.md, "Stage").
  • The kernel's sheet: browser/theme.css becomes browser/base.css, and the comments that pointed at it follow. The composed page stylesheet keeps its served name, /theme.css, as do the examples' own STEM.page/theme.css page files.
  • One list of the kernel's files: schema.KERNEL_FILES (KERNEL_STYLES plus registry and icon) sits beside PACKAGE_FILES. The layer check, layer.input_paths and the server identity (runtime_selection.LAYER_SOURCES) read it instead of LAYER_TOP_FILES, the names a composed layer serves. That list had left out layouts.css and state.css, so an edit to either changed neither what a live preview follows nor the identity that refuses a stale open document.

Chips

The lf-tally count and the change counts on a tab or a settled decision wore the reading theme's .tag, so with --no-theme they drew as bare text. They now wear .lf-chip, whose face packages/default/styles/chip.css states once beside lf-option's author chips, replacing the copy options.css kept. The change-count tint moves there from the kernel, which no longer names a default-package class. With the reading theme, command-hub's tally and option chips compute the same faces as on main (leaf-dev probe --base).

Comments

Checks

Model tests for the layer, themes, documents, revision and module delivery and previews (one failure, test_preview_file_subscription_follows_atomic_replacements, which fails on main too), and pnpm run check. Codex reviewed the rename; its one finding, the eval prompt, is fixed.

This was written by Claude Code on behalf of max-sixty

…its own chips

A package's stylesheet roles were named for content: widgets.css held every
package's defaults, a theme's look included, and theme.css held the rules that
outrank Layouts, in the `lf-theme` tier. Since the reading look moved into
widgets.css, neither name said what it does. They are now defaults.css (lf-base,
below Layouts) and overrides.css (the `lf-overrides` tier, above them), across
the composer, `schema.PACKAGE_STYLES`, `package init`'s scaffold, the bundled
packages, the references, docs/extending.html and the tests. Behaviour is
unchanged: each sheet keeps its tier and order. A package still shipping
widgets.css or theme.css contributes nothing until renamed.

The default package's own chips (lf-tally's count, a tab's and a settled
decision's change count) wore the reading theme's `.tag`, so a page with no
theme drew them as bare text. They now wear the package's `.lf-chip`, whose
face packages/default/styles/chip.css states once beside lf-option's author
chips, and the change-count tint moves there from the kernel, which no longer
names a default-package class. With the reading theme their computed faces are
unchanged (command-hub's tally and option chips, probed against main).

theme.css's comment on the anonymous important layer now names what outranks
it: lf-reset, Web Awesome's lf-vendor sublayer and inline importance.
The guard's header named what still reaches the chrome but not why a shadow
root, which would stop all of it, isn't used: anchors can't cross into one in
any engine (#2828), and the direction was dropped (#3579).
Its prompt named theme.css and shadow.css, neither of which a package's
document and shadow rules go in; it now names defaults.css and
widget-shadow.css.
# Conflicts:
#	dev/tests/model/test_interact_preview.py
#	tests/journeys/test_interact_layer.py
… one place

browser/theme.css held the kernel's defaults in lf-base: tokens, the faces of
Leaf's controls and the guarantee rules. Since the reading look became an
optional theme package, "theme" names that package and a tier it isn't in, so
the kernel's sheet is now browser/base.css, and comments that pointed at it
say so. The composed page stylesheet keeps its served name, /theme.css.

The kernel's files now have a home of their own, `schema.KERNEL_FILES`
(`KERNEL_STYLES` plus its registry and icon), beside `PACKAGE_FILES`. The
layer check, `layer.input_paths` and the server's identity
(`runtime_selection.LAYER_SOURCES`) read it instead of `LAYER_TOP_FILES`, the
names a composed layer serves. That list had stood in for the kernel's own and
left out layouts.css and state.css, so an edit to either changed neither what
a preview follows nor the identity that refuses a stale open document.

Comments in the default package that called the kernel's sheet "the kernel
theme" name it, and the apparatus rule's comment points at the core's and the
reading theme's copies, where the split left them.
…part rule

The guard's header said no engine lets a shadow-root element anchor to the
document. A probe of the three engines (Chromium 156, Firefox 157, WebKit 27.2)
shows that holds only for a name the shadow tree's own styles give, whether in
its sheet, inline or through var(); a document ::part() rule setting
position-anchor anchors in all three. csswg-drafts#9408 resolved that shadow
trees may name higher-tree anchors, and no engine ships it yet.
leaf-agent
leaf-agent previously approved these changes Oct 29, 2026
leaf-agent
leaf-agent previously approved these changes Oct 29, 2026
# Conflicts:
#	browser/runtime/chrome.css
#	dist/kernel/kernel.json
@max-sixty
max-sixty merged commit daf2bcf into main Oct 29, 2026
4 checks passed
@max-sixty
max-sixty deleted the leaf-out-of-the-way branch October 29, 2026 06:12
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.

2 participants