Skip to content

State each colour's two schemes in one light-dark(), and name the z-index scale - #756

Merged
max-sixty merged 4 commits into
mainfrom
cascade-layers
Sep 17, 2026
Merged

max-sixty merged 4 commits into
mainfrom
cascade-layers

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Every colour token in theme.css now states its light and dark values in one light-dark(), so the 29-line prefers-color-scheme: dark block is gone and a token can no longer be changed in one scheme and missed in the other. The root already set color-scheme: light dark, which picks the half. The MCP app sets color-scheme on its shadow host for the host's declared theme, so split_theme and the snapshot's darkTheme go.

The 24 stacking literals in theme.css and chrome.css now read 17 named --lf-z-* tokens, listed in order in :root. The values are unchanged.

The @layer half of the TODO row was tried and backed out; the row stays open with the finding. With Leaf's sheets layered, a page's unlayered <style> outranks all of them, so a page div { position: relative } moved 53 chrome boxes including the aim (test_render_aim). Giving chrome.css its own rung also flipped the specificity contests it was written against theme.css with, such as a thread's focus tint.

Full suite with --run-nightly locally, before merging main: 2691 passed, 4 failed, and all 4 also fail when run on a merge-base worktree: test_a_stale_package_widget_uses_recursive_parent_eligibility, test_the_room_is_measured_after_a_late_rail, test_the_margin_groups_meanings_at_one_destination_without_moving_the_page (repaired on main by #752), and test_a_current_auxiliary_choice_replaces_a_persisted_tray_during_replay.

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

max-sixty and others added 3 commits September 16, 2026 23:39
…ndex scale

Every colour token in theme.css now carries its light and dark values in one
`light-dark()`, so the 29-line `prefers-color-scheme: dark` block is gone and a
token cannot be updated in one scheme and forgotten in the other. `color-scheme:
light dark` on the root was already there to pick the half. The MCP app follows:
it sets `color-scheme` on its shadow host for the host's declared theme, and
`split_theme` and the snapshot's `darkTheme` are gone.

The 24 stacking literals in theme.css and chrome.css read seventeen named
`--lf-z-*` tokens, listed in order in `:root`. The values are unchanged.

The TODO row for ordering the cascade with `@layer` stays open, with what trying
it found: a page's unlayered `<style>` outranks every layered Leaf rule, so a
page `div { position: relative }` moved 53 chrome boxes, and no rung order
keeps the chrome above the page while theme.css and chrome.css keep contesting
each other by specificity.

Co-Authored-By: Claude Opus 5 <[email protected]>
@max-sixty
max-sixty merged commit b971b33 into main Sep 17, 2026
4 checks passed
@max-sixty
max-sixty deleted the cascade-layers branch September 17, 2026 08:20
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