fix(dropdown-menu): make submenu indicator icon and divider spacing themable - #4667
fix(dropdown-menu): make submenu indicator icon and divider spacing themable#4667athz wants to merge 1 commit into
Conversation
…hemable Two follow-ups to the menu theme-slot work: - The astryx-dropdown-menu-indicator-icon target sat on the wrapper span, one level above the Icon that owns the glyph size — so a theme rule on it could not reach the size. Move the target onto the Icon element itself (Icon merges className onto the sized element), so a theme can restyle the chevron's size and color directly. - The menu divider's vertical margin was a fixed token that the single- class astryx-dropdown-menu-divider target could not out-specify against the global two-class .astryx-divider.horizontal rule. Expose it as --_dropdown-menu-divider-margin (default: the token), matching the component's existing private-var pattern, so a theme retunes the var instead of fighting specificity.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsDropdownMenu (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
I have some plans for how we do indicator icon mapping. For the other parts though:
|
| derived: [ | ||
| {property: 'borderRadius', vars: ['--_dropdown-menu-radius']}, | ||
| {property: 'padding', vars: ['--_dropdown-menu-padding']}, | ||
| {property: 'marginBlock', vars: ['--_dropdown-menu-divider-margin']}, |
There was a problem hiding this comment.
Hmm I think this communicates that margin block is converted to the internal bar for block margin around the divider which is kind of odd at the menu level
| const endAffordance = hasSpinner ? ( | ||
| <span | ||
| {...mergeProps( | ||
| themeProps('dropdown-menu-indicator-icon'), |
There was a problem hiding this comment.
This should be kept the same
| icon="chevronRight" | ||
| size="sm" | ||
| color="secondary" | ||
| {...themeProps('dropdown-menu-indicator-icon')} |
There was a problem hiding this comment.
Hmm seems odd to theme the size here when we apply size consistently. Have an example for how you're adjusting it?
What
Two follow-ups to the DropdownMenu theme-slot work (#4600) — both fix cases where a slot exists but the property a theme wants to change doesn't actually flow through it.
Submenu indicator icon — size now themable
The
astryx-dropdown-menu-indicator-icontarget sat on the wrapper<span>, one level above the<Icon>that owns the glyph'swidth/height. A theme rule on the span could restyle the wrapper but never the icon size. Moved the target onto the<Icon>element itself (Icon mergesclassNameonto the same element that carries its size class), so a theme can now restyle the chevron's size and color directly — same mechanism asselector-indicator-icon.Menu divider spacing — vertical margin now themable
The menu divider's
margin-blockwas a fixed token applied via a StyleX atomic class. The single-class.astryx-dropdown-menu-dividertarget (specificity 0,1,0) could not out-specify the global two-class.astryx-divider.horizontalrule (0,2,0) in the same layer, so a theme's margin override was always lost. Exposed the margin as--_dropdown-menu-divider-margin(default: the existing token), matching the component's existing--_dropdown-menu-radius/--_dropdown-menu-paddingprivate-var pattern — a theme retunes the var instead of fighting specificity.Scope
Purely a theming-reachability fix — no behavior, layout, or a11y change; the default rendering is byte-identical. Documented the new private var in the component's theming
vars/derived.Testing
astryx-icon), i.e. the element that owns the size.@astryxdesign/core: DropdownMenu + ContextMenu + Breadcrumbs suites pass (154 tests), plustypecheck,typecheck:docs,sync-exports --check, and lint.