Skip to content

Explain where CSS overrides go, and fix two rules that matched nothing - #2796

Merged
max-sixty merged 2 commits into
mainfrom
css-override-layers
Oct 14, 2026
Merged

max-sixty merged 2 commits into
mainfrom
css-override-layers

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

How it Works gains "Styles and overrides" on its Pages tab: a figure of the cascade tiers in the document and in a widget's shadow tree, then where CSS goes to override something for one page, for a Layout, and for a widget or package, and what each place can and cannot reach. Every claim was checked by probing rendered pages built from this tree.

The survey found two rules that silently did nothing:

  • The site package's body.site-page main { padding-top: 28px } has lost to the column Layout's padding in lf-layouts since Layouts moved above lf-base (Arrange pages with Layout classes, and let margins claim nothing #1246), so site pages started 72px down. It now sets the --page-pad-start token the Layout reads; pages start 28px down, as the rule's comment intended.
  • The extension guide's package CSS began lf-callout {, which matches nothing: composition scopes a widget package's sheet to its tags, and a type selector inside @scope does not match the root. It now uses :scope.

packages.md adds the page geometry inputs Layouts read (--col, --wide, --sidebar, --page-pad-*) to its theme inputs and says a package that declares widgets reaches only inside them. page-authoring.md's example selector lf-board .lf-btn matched no control; it is now lf-board .lf-grip.

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

How it Works gains "Styles and overrides" on its Pages tab: a figure of the
cascade tiers in the document and in a widget's shadow tree, and where a page,
a Layout change, and a widget or package override go and what each can reach.
The claims were checked by probing rendered pages.

The survey found two rules that silently did nothing:

- The site package set `body.site-page main { padding-top: 28px }`, which the
  column Layout's padding in `lf-layouts` has outranked since Layouts moved
  above `lf-base`, so site pages started 72px down. It now sets the
  `--page-pad-start` token the Layout reads, and the pages start 28px down
  again, as the rule's comment intended.
- The extension guide's package CSS began `lf-callout {`, which matches
  nothing because composition scopes a widget package's sheet to its tags and
  a type selector inside `@scope` does not match the root. It now uses
  `:scope`.

packages.md lists the page geometry inputs Layouts read among the theme
inputs, and says a package that declares widgets reaches only inside them.
page-authoring.md's example selector `lf-board .lf-btn` matched no control;
it is now `lf-board .lf-grip`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
leaf-agent previously approved these changes Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@max-sixty
max-sixty merged commit e4e5827 into main Oct 14, 2026
3 checks passed
@max-sixty
max-sixty deleted the css-override-layers branch October 14, 2026 01:39
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