Skip to content

fix(AppShell): replace hardcoded px values in autoMobileTopBar with spacing tokens - #667

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

cixzhang merged 1 commit into
mainfrom
navi/theme-audit/appshell

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The autoMobileTopBar style in XDSAppShell used hardcoded pixel values that don't respond to theme overrides:

// Before
autoMobileTopBar: {
  height: 48,        // ❌ hardcoded
  paddingInline: 8,  // ❌ hardcoded
}

// After
autoMobileTopBar: {
  height: spacingVars['--spacing-12'],   // ✅ 48px via token
  paddingInline: spacingVars['--spacing-2'],  // ✅ 8px via token
}

This ensures the mobile top bar respects theme spacing overrides, so custom themes that adjust spacing scale will have the mobile nav bar respond correctly.

Checklist

  • CSS variable usage — all visual properties use tokens
  • No change to component reuse patterns
  • xdsClassName placement unchanged (root element, correct)

*Night Watch — Theme Auditor |

…pacing tokens

autoMobileTopBar had hardcoded height: 48 and paddingInline: 8 which don't
respond to theme overrides. Replaced with spacingVars['--spacing-12'] (48px)
and spacingVars['--spacing-2'] (8px) so themes can adjust spacing consistently.

Night Watch — Theme Auditor

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

AppShell · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 801B N/A
Lines of Code N/A 540 -
Complexity N/A Very High (83) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 10.2KB 16.3KB 2.5KB

Accessibility Audit

Status: No accessibility violations detected.


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

@cixzhang
cixzhang merged commit 5d5f67d into main Mar 18, 2026
11 checks passed
@cixzhang
cixzhang deleted the navi/theme-audit/appshell branch March 20, 2026 16:59
cixzhang added a commit that referenced this pull request Apr 26, 2026
cixzhang added a commit that referenced this pull request Jun 21, 2026
cixzhang added a commit that referenced this pull request Jun 21, 2026
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