Repository navigation
feat(core): give ComplexSelector and MultiSelector popups a theme target - #4991
Merged
Merged
Conversation
Both components target their trigger but nothing in the popup, so a theme cannot style the surface that has to match the rest of an app's menus. The target goes on the popup's content box, not the layer: useLayer zeroes the layer's borders, padding and background, so the content box is what paints. Purely additive — default rendering is unchanged.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsComplexSelector (@astryxdesign/core) · View in Storybook
MultiSelector (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
cixzhang
added a commit
that referenced
this pull request
Aug 14, 2026
…5009) * fix(core): move the popup theme targets onto the surface that paints The targets added in #4991 landed on each component's content box, while the element carrying background, radius and elevation is the surface usePopover renders one level above it. A theme rule written against those classes could not paint the popup. usePopover now names the surface: a shared astryx-popover-surface on every popup, plus an optional per-component surfaceTarget. Selector gains the astryx-selector-popup its sibling MultiSelector already had. * test(cli): teach the documented-target guard about surfaceTarget The guard scans core for themeProps()/stableClassName()/legacyNames literals. A surface target is a literal too — it just rides a usePopover option, because the element it names is not the component's to render.
4 tasks done
This branch was successfully deployed
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.
Why
A theme can style a
ComplexSelectortrigger and nothing inside its popup. Both this component andMultiSelectorrender a stable target on the field (astryx-complex-selector,astryx-multi-selector) and on inner details — the chevron, the option row, the empty state — but the popup surface itself carries no target at all. That surface is the part that has to match the rest of an app's menus: its background, border, radius and elevation are what make a picker look like it belongs, and today they can only be reached by forking the component or writing a structural selector against StyleX-generated classes.The gap has bitten a real consumer. In #4804 an app's menu came out 24px wider than its own panels with no border, reading as edgeless on a dark theme; the workaround shipped there pulls the content back out to the surface edge with a negative margin and repaints the border, which depends on the component's internal padding staying what it is.
What
astryx-complex-selector-popupandastryx-multi-selector-popup, on the popup's content box. Purely additive: no API change, no default visual change.The target goes on the content box, not the layer.
useLayerzeroes the layer element's borders, padding and background — it is a bare positioning box — so the content box inside it is the element that actually paints, and it is the one a theme has to reach. That is the convention worth settling for the whole layer family: the popup's paint surface gets<component>-popup, alongside the existing<component>-<part>sub-element targets.Selectoris deliberately not in this change. Its popup root differs by branch — withhasSearchit is a wrapper div, without it the listbox itself — so a stable target there means unifying that structure first, which does not belong in an additive theming change. Happy to follow up.Not addressed here, and worth their own issues:
HoverCard,TooltipandMoreMenurender no theme targets at all, andcontentXstyleremains StyleX-only, which is the other half of #4804.Risk
None expected. The classes are new, nothing is renamed or moved, and no styles change.
themingTargets.test.tsenforces that everythemeProps()class is documented, so the newtheming.targetsentries are covered by that guard.Testing
viteston both components: 104 pass, including three new assertions that the target lands on the content box inside the layer and not on the layer itself, and that it survives a consumer-suppliedcontentXstyle. Neutralizing eachthemeProps()call fails exactly those tests and nothing else.packages/coretypecheck and eslint clean; thethemesuite (620 tests, including thethemingTargetsguard) passes.