feat(ComplexSelector): stable theme target for the popup surface - #4821
Open
AKnassa wants to merge 2 commits into
Open
feat(ComplexSelector): stable theme target for the popup surface#4821AKnassa wants to merge 2 commits into
AKnassa wants to merge 2 commits into
Conversation
The popup surface had no stable class: contentXstyle is StyleX-typed
and the surface element carried only hashed atomic classes, so
non-StyleX consumers could not style the popup's background, border,
radius, or width at all (route A of the RFC).
The popup content container now paints the surface itself (usePopover
hasSurface: false + the exported popoverSurfaceStyles, same tokens) and
carries themeProps('complex-selector-popup'), so defineTheme components
and plain stylesheets reach the element that owns the surface paint,
and contentXstyle can override it too. Rendered defaults unchanged.
Refs facebook#4804
|
@AKnassa is attempting to deploy a commit to the Meta Open Source Team on Vercel. A member of the Team first needs to authorize it. |
Self-review round on facebook#4821: the declares() helper could match a longer atomic class sharing a prefix (.x14o matched .x14odbl rules), weakening assertions in both directions; a boundary lookahead closes it. The paint assertions now pin the exact surface tokens (--color-background-popover, --radius-container, --shadow-low) so the test states what the changeset promises: same tokens, same surface.
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsComplexSelector (@astryxdesign/core) · View in Storybook
Popover (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
AKnassa
marked this pull request as ready for review
August 8, 2026 04:05
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.
What this does
Gives the ComplexSelector popup a stable
astryx-complex-selector-popupclass, so apps that do not use StyleX can style the popup the way they already style the trigger.Refs #4804 (route A).
Why
The trigger takes
className, but the popup surface rendered only hashed classes. A theme or plain stylesheet had no way to give the popup a border, a different background, a radius, or a width.What changed
usePopoverwithhasSurface: falseplus the same background, radius, and shadow tokens, shared via an exportedpopoverSurfaceStyles). Styles aimed at the class land on the element that owns the popup's look, with nothing painting behind it. Rendered defaults are unchanged.contentXstylemerges after the surface styles, so it can now override background, border, radius, and shadow too. Prop docs updated.contentXstylebackground no longer composites over an opaque default (the page shows through), and a themed width narrower than the trigger leaves the layer at the trigger's width for anchor positioning, so the strip beside the panel does not light-dismiss. No in-repo consumer relies on either; existing stories that widen the popup throughcontentXstylerender identically.defineThemealone.Example:
How to see it
Storybook, Core/ComplexSelector, "Themed popup surface": open the selector and the popup is a flat bordered panel. "Fruit ripeness selector" shows the defaults, unchanged.
Validation