Repository navigation
Name Leaf's stylesheets by where they rank, and give the default package its own chips - #4653
Merged
Merged
Conversation
…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.
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
previously approved these changes
Oct 29, 2026
leaf-agent
previously approved these changes
Oct 29, 2026
# Conflicts: # browser/runtime/chrome.css # dist/kernel/kernel.json
leaf-agent
approved these changes
Oct 29, 2026
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.
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
widgets.cssbecomesdefaults.css(inlf-base, below Layouts) andtheme.cssbecomesoverrides.css, in the tierlf-themerenamedlf-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 thenative-package-scopeseval prompt follow. A package still shipping the old names contributes nothing (AGENTS.md, "Stage").browser/theme.cssbecomesbrowser/base.css, and the comments that pointed at it follow. The composed page stylesheet keeps its served name,/theme.css, as do the examples' ownSTEM.page/theme.csspage files.schema.KERNEL_FILES(KERNEL_STYLESplus registry and icon) sits besidePACKAGE_FILES. The layer check,layer.input_pathsand the server identity (runtime_selection.LAYER_SOURCES) read it instead ofLAYER_TOP_FILES, the names a composed layer serves. That list had left outlayouts.cssandstate.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-tallycount and the change counts on a tab or a settled decision wore the reading theme's.tag, so with--no-themethey drew as bare text. They now wear.lf-chip, whose facepackages/default/styles/chip.cssstates once besidelf-option's author chips, replacing the copyoptions.csskept. 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 onmain(leaf-dev probe --base).Comments
base.css's anonymous important layer no longer claims to outrank every other layer: it names what wins over it, which islf-reset, Web Awesome'slf-vendorsublayer and inline importance.chrome-guard.cssrecords what a shadow-root chrome would cost: no engine yet lets a shadow tree's own styles name a documentanchor-name(the spike, e7745b7, Record that no engine anchors from a shadow root to the outer document #2828), though a document::part()rule settingposition-anchoranchors in Chromium, Firefox and WebKit today; the direction was set aside in Act on more TODO decisions: samples stay off the clipboard, drop a gap entry and an eval, mark deferred items #3579, and Let a page restyle Leaf's chrome on purpose #4030 would bring it back.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 onmaintoo), andpnpm run check. Codex reviewed the rename; its one finding, the eval prompt, is fixed.