Skip to content

fix(MoreMenu): add xdsClassName for theme targeting - #672

Merged
cixzhang merged 1 commit into
mainfrom
navi/theme-audit/more-menu
Mar 18, 2026
Merged

cixzhang merged 1 commit into
mainfrom
navi/theme-audit/more-menu

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds xdsClassName('more-menu') to the MoreMenu dropdown panel element, enabling theme authors to target it via @scope.

Why

XDSDropdownMenu applies xdsClassName('dropdown-menu') on its panel, but XDSMoreMenu (a convenience wrapper) was missing this — themes couldn't independently style the MoreMenu dropdown.

Changes

  • XDSMoreMenu.tsx: Import xdsClassName and mergeProps from utils; apply xdsClassName('more-menu') to the dropdown <div> using the mergeProps pattern
  • XDSMoreMenu.test.tsx: Add test verifying xds-more-menu class is present on the dropdown panel

Needs Review

  • List dividers: XDSList renders inter-item dividers as raw <hr> elements with inline StyleX styles (backgroundColor: colorVars['--color-divider']) rather than using XDSDivider. The token usage is correct, but theme @scope rules targeting .xds-divider won't cascade to these dividers. This is a design decision — should List dividers be XDSDivider instances for full theme targeting, or is the lightweight <hr> approach preferred for performance?

Add xdsClassName('more-menu') to the dropdown panel element so themes
can target MoreMenu via @scope. Without this, theme authors couldn't
style the MoreMenu dropdown panel independently.

Uses mergeProps to combine xdsClassName with stylex.props, matching the
pattern used by XDSDropdownMenu.

Co-authored-by: Navi <[email protected]>
@cixzhang cixzhang added theming Theming system, design tokens, createTheme hardening Component hardening and quality sweep labels Mar 18, 2026
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 18, 2026
@github-actions

github-actions Bot commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

Modified Components

MoreMenu · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 593B N/A
Lines of Code N/A 369 -
Complexity N/A Very High (49) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 10.3KB 16.5KB 2.6KB

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@cixzhang
cixzhang merged commit 59f9ded into main Mar 18, 2026
11 checks passed
@cixzhang
cixzhang deleted the navi/theme-audit/more-menu branch March 18, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. hardening Component hardening and quality sweep theming Theming system, design tokens, createTheme

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant