Skip to content

fix: dark StyleScope solids on a light page; dropdowns open from the field - #543

Merged
lorant-one merged 2 commits into
feat/3-0-breaking-cleanupfrom
feat/3-0-breaking-cleanup-giduz4
Nov 17, 2026
Merged

lorant-one merged 2 commits into
feat/3-0-breaking-cleanupfrom
feat/3-0-breaking-cleanup-giduz4

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Two fixes for 3.0 that are holding rc.0.

1. Brand solids in a nested theme (foundations)

Before: a dark StyleScope with solid: "contrast" on a light page kept light's black primary buttons. The page's [data-theme="light"] [data-solid] rules matched the scope with the same specificity as its own dark rules, and they come later in tokens.css. The color and inverse solids had the same problem, and so did the reverse case (light inside dark). A section without its own data-solid took the page's solid in the page's theme. In a browser matrix of themes, solids and brands nested up to three levels, 56 of 128 cases rendered wrong.

After: the brand solids follow the nearest data-theme and the nearest data-solid, three levels deep, including data-theme="invert". All 128 nested cases and 24 invert cases match a standalone page with the same theme and solid. Before this change, 8 of the 24 invert cases matched.

How: the six brand-solid rules now match under conditions that weigh nothing and that only the nearest theme-and-solid pair meets. A Sass function writes them. Rule order no longer decides which rule wins. Each block keeps its plain [data-theme][data-solid] selector, so the token export and the tests still read it. The token export now splits selector lists only at top-level commas. Its output is the same token values, with one entry per theme and solid pair instead of two identical ones. tokens.css grows by about 8 KB before compression.

2. Dropdowns on a field with a description (core)

Before: a Select with a description opened its list below the helper text, because the dropdown anchored to the whole trigger. This was seen in Sigilio's contract form.

After: when the trigger has a field box (data-surface="field"), the dropdown anchors to it, so the list opens right under the field and covers the description. A new test opens the list at 44px from the field; before the fix it opened at 76px.

Checks: core tests 4,700 passed. The one failure was the RichTextEditor test, which passes when run on its own; it has failed before only when the full suite runs. Foundations tests 68/68, check:tokens up to date, tsc clean, lint gate at baseline (116).


Generated by Claude Code

A dark StyleScope with data-solid="contrast" on a light page kept light's
black primary buttons: the page's [data-theme=light] [data-solid] rules
matched the scope with the same specificity as its own dark rules and came
later. The six brand-solid rules now match under zero-specificity conditions
that only the nearest theme-and-solid pair meets, three levels deep, so
order no longer decides. The token export splits selector lists at their
top-level commas and keeps one entry per pair (it had two identical ones).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1
The dropdown anchored to the whole trigger, so a Select with a description
opened its list under the helper text. It now anchors to the field box
(data-surface="field") when the trigger has one, and the brand-solid
selector helper writes unquoted attributes so the theme union parity test
reads only real values.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YJHdG7ZbpQS64MtL5PVbT1
@lorant-one
lorant-one merged commit 2f68d61 into feat/3-0-breaking-cleanup Nov 17, 2026
10 checks passed
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