Skip to content

fix(theme): xdsClassName for TimeInput and Tooltip, fix hardcoded fontSize - #749

Merged
cixzhang merged 3 commits into
mainfrom
navi/theme-audit/batch-2026-03-20-d
Mar 20, 2026
Merged

cixzhang merged 3 commits into
mainfrom
navi/theme-audit/batch-2026-03-20-d

Conversation

@cixzhang

@cixzhang cixzhang commented Mar 20, 2026 •

Copy link
Copy Markdown
Contributor

Theme Audit — 2026-03-20 (batch run)

Audited 5 components: TextInput, TimeInput, Token, Tokenizer, Tooltip.

Fixes

TimeInput — missing xdsClassName

  • Added xdsClassName('time-input', {size}) on the wrapper div using mergeProps, matching the pattern in TextInput.
  • Without this, themes cannot target TimeInput via @scope.

Tooltip — hardcoded fontSize

  • Replaced fontSize: 14 with textSizeVars['--text-base'] in the tooltip container styles.
  • The value 14px maps exactly to the --text-base token (0.875rem), so no visual change — but now it respects theme overrides.

Tooltip — missing xdsClassName

  • Added xdsClassName('tooltip') on the content div via mergeProps, matching the pattern in HoverCard (xdsClassName('hovercard')) and Popover (xdsClassName('popover')).

Clean (no issues)

  • TextInput — fully themed with CSS variables, uses XDSField/XDSIcon/XDSSpinner, has xdsClassName
  • Token — fully themed, uses XDSIcon, has xdsClassName on all render paths (href, onClick, static)

Skipped

  • Tokenizer — composition wrapping XDSBaseTypeahead, XDSToken, XDSField. Per the theme auditor nuance section: adding xdsClassName to the wrapper would create specificity conflicts with inner components' own theming.

Needs Review

None — all fixes are straightforward objective issues.


…fontSize in Tooltip

Theme audit batch for 2026-03-20:

- TimeInput: Add xdsClassName('time-input', {size}) on wrapper div for
  theme targeting, matching TextInput's pattern
- Tooltip: Replace hardcoded fontSize: 14 with textSizeVars['--text-base']
- Tooltip: Add xdsClassName('tooltip') on content div for theme targeting,
  matching HoverCard and Popover patterns

Audited: TextInput (clean), TimeInput, Token (clean), Tokenizer (skipped —
composition wrapping themed components), Tooltip

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

github-actions Bot commented Mar 20, 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

Layer · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 659B N/A
Lines of Code N/A 273 -
Complexity N/A High (30) -
TimeInput · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 499B N/A
Lines of Code N/A 384 -
Complexity N/A Very High (54) -
Tooltip · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A 305B N/A
Lines of Code N/A 415 -
Complexity N/A Very High (47) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@xds/core 10.7KB 17.0KB 2.6KB

Accessibility Audit

Status: No accessibility violations detected.


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

The main visual styles (background, border-radius, typography) live on
the container div, so xdsClassName('tooltip') belongs there for proper
theme targeting via @scope.

Added className support to ContextRenderProps in useXDSLayer so any
layer consumer can attach xdsClassName to the popover container.

Co-authored-by: Navi <[email protected]>
@cixzhang
cixzhang requested a review from josephfarina as a code owner March 20, 2026 17:49
@cixzhang

Copy link
Copy Markdown
Contributor Author

Fixed in 3403d0b — moved xdsClassName('tooltip') to the container div. Added a className prop to ContextRenderProps in useXDSLayer so any layer consumer can attach xdsClassName to the popover container. This keeps the pattern available for HoverCard/Popover if needed later.

Both ContextRenderProps and FixedRenderProps now accept all three
props (xstyle, className, style) for consistent container
customization. Previously FixedRenderProps only had x/y and
ContextRenderProps was missing style.

Co-authored-by: Navi <[email protected]>
@cixzhang
cixzhang merged commit 4ebae33 into main Mar 20, 2026
12 checks passed
@cixzhang
cixzhang deleted the navi/theme-audit/batch-2026-03-20-d branch March 20, 2026 18:01
cixzhang added a commit that referenced this pull request Apr 26, 2026
…tSize (#749)

* fix(theme): add xdsClassName to TimeInput and Tooltip, fix hardcoded fontSize in Tooltip

Theme audit batch for 2026-03-20:

- TimeInput: Add xdsClassName('time-input', {size}) on wrapper div for
  theme targeting, matching TextInput's pattern
- Tooltip: Replace hardcoded fontSize: 14 with textSizeVars['--text-base']
- Tooltip: Add xdsClassName('tooltip') on content div for theme targeting,
  matching HoverCard and Popover patterns

Audited: TextInput (clean), TimeInput, Token (clean), Tokenizer (skipped —
composition wrapping themed components), Tooltip

Co-authored-by: Navi <[email protected]>

* fix(theme): move xdsClassName to container for Tooltip

The main visual styles (background, border-radius, typography) live on
the container div, so xdsClassName('tooltip') belongs there for proper
theme targeting via @scope.

Added className support to ContextRenderProps in useXDSLayer so any
layer consumer can attach xdsClassName to the popover container.

Co-authored-by: Navi <[email protected]>

* feat(layer): support style, className, xstyle on both render modes

Both ContextRenderProps and FixedRenderProps now accept all three
props (xstyle, className, style) for consistent container
customization. Previously FixedRenderProps only had x/y and
ContextRenderProps was missing style.

Co-authored-by: Navi <[email protected]>

---------

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
…tSize (#749)

* fix(theme): add xdsClassName to TimeInput and Tooltip, fix hardcoded fontSize in Tooltip

Theme audit batch for 2026-03-20:

- TimeInput: Add xdsClassName('time-input', {size}) on wrapper div for
  theme targeting, matching TextInput's pattern
- Tooltip: Replace hardcoded fontSize: 14 with textSizeVars['--text-base']
- Tooltip: Add xdsClassName('tooltip') on content div for theme targeting,
  matching HoverCard and Popover patterns

Audited: TextInput (clean), TimeInput, Token (clean), Tokenizer (skipped —
composition wrapping themed components), Tooltip

Co-authored-by: Navi <[email protected]>

* fix(theme): move xdsClassName to container for Tooltip

The main visual styles (background, border-radius, typography) live on
the container div, so xdsClassName('tooltip') belongs there for proper
theme targeting via @scope.

Added className support to ContextRenderProps in useXDSLayer so any
layer consumer can attach xdsClassName to the popover container.

Co-authored-by: Navi <[email protected]>

* feat(layer): support style, className, xstyle on both render modes

Both ContextRenderProps and FixedRenderProps now accept all three
props (xstyle, className, style) for consistent container
customization. Previously FixedRenderProps only had x/y and
ContextRenderProps was missing style.

Co-authored-by: Navi <[email protected]>

---------

Co-authored-by: Navi <[email protected]>
cixzhang added a commit that referenced this pull request Jun 21, 2026
…tSize (#749)

* fix(theme): add xdsClassName to TimeInput and Tooltip, fix hardcoded fontSize in Tooltip

Theme audit batch for 2026-03-20:

- TimeInput: Add xdsClassName('time-input', {size}) on wrapper div for
  theme targeting, matching TextInput's pattern
- Tooltip: Replace hardcoded fontSize: 14 with textSizeVars['--text-base']
- Tooltip: Add xdsClassName('tooltip') on content div for theme targeting,
  matching HoverCard and Popover patterns

Audited: TextInput (clean), TimeInput, Token (clean), Tokenizer (skipped —
composition wrapping themed components), Tooltip


* fix(theme): move xdsClassName to container for Tooltip

The main visual styles (background, border-radius, typography) live on
the container div, so xdsClassName('tooltip') belongs there for proper
theme targeting via @scope.

Added className support to ContextRenderProps in useXDSLayer so any
layer consumer can attach xdsClassName to the popover container.


* feat(layer): support style, className, xstyle on both render modes

Both ContextRenderProps and FixedRenderProps now accept all three
props (xstyle, className, style) for consistent container
customization. Previously FixedRenderProps only had x/y and
ContextRenderProps was missing style.


---------
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