Skip to content

fix(Collapsible): replace hardcoded fontSize and transition with theme tokens - #677

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

cixzhang merged 1 commit into
mainfrom
navi/theme-audit/batch-2026-03-18

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Theme Audit — 2026-03-18

Batch audit of 5 components: CheckboxInput, Collapsible, DateInput, Dialog, Divider.

Findings

Collapsible — 2 hardcoded values replaced with tokens:

  • fontSize: 16 → textSizeVars['--text-lg'] (trigger text) — same 1rem/16px value, but now themeable
  • transition: 'transform 150ms ease' → transitionVars['--transition-fast'] (chevron rotation) — now respects theme transition speed

Clean Components (no issues found)

  • CheckboxInput — all colors, spacing, radius use tokens. Size dimensions (18-24px) are structural intrinsic sizing, not semantic spacing. Inline SVG checkmark is the component's own visual, not an icon registry candidate. Uses XDSFieldLabel, XDSFieldStatus, XDSSpinner correctly. xdsClassName on root with size variant. ✅
  • DateInput — fully tokenized (colorVars, radiusVars, typographyVars, textSizeVars, etc.). Uses XDSIcon, XDSCalendar, XDSField, XDSSpinner. xdsClassName on input wrapper (the visual element). ✅
  • Dialog — uses colorVars, radiusVars, transitionVars, elevationVars. borderRadius: 0 in fullscreen is intentional (0 is an allowed exception). xdsClassName on <dialog> with variant. ✅
  • DialogHeader — uses XDSButton(ghost) for close, XDSIcon for close icon, XDSHeading/XDSText for title/subtitle. All spacing from spacingVars. ✅
  • Divider — fully tokenized. xdsClassName with variant and orientation. ✅

Needs Review

None — both fixes are straightforward token replacements with identical default values.


- fontSize: 16 → textSizeVars['--text-lg'] (same 1rem/16px value via token)
- transition: 'transform 150ms ease' → transitionVars['--transition-fast']

Both values now participate in theming. A theme override of
--text-lg or --transition-fast will cascade to the collapsible trigger.

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

Collapsible · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 4.6KB N/A
Lines of Code N/A 241 -
Complexity N/A High (18) -

Bundle Size Summary

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

Accessibility Audit

Status: No accessibility violations detected.


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

@cixzhang
cixzhang merged commit 0fb6827 into main Mar 18, 2026
11 checks passed
@cixzhang
cixzhang deleted the navi/theme-audit/batch-2026-03-18 branch March 20, 2026 16:59
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