Skip to content

fix: update MD3 default theme color tokens#4886

Open
wonderlul wants to merge 1 commit intocallstack:mainfrom
wonderlul:fix/md3-default-theme-tokens
Open

fix: update MD3 default theme color tokens#4886
wonderlul wants to merge 1 commit intocallstack:mainfrom
wonderlul:fix/md3-default-theme-tokens

Conversation

@wonderlul
Copy link
Copy Markdown

Motivation

The default MD3 light theme had incorrect tonal mappings for onContainer color roles. The Material Design 3 specification defines these roles as tone 30 of their respective palettes, but the implementation was using tone 10, which produces near-black colors that are too dark and do not match the intended design.

The same issue affected onErrorContainer in the dark theme, which was mapped to tone 80 instead of the correct tone 90.

Related issue

No existing issue. The incorrect tonal mappings appear to have been present since the initial MD3 theme implementation.

Test plan

  1. Run yarn test — all tests pass after snapshot updates and a correction to the hardcoded expected color value in BottomNavigation.test.tsx.
  2. In an app using the default MD3 theme, inspect components that use onPrimaryContainer, onSecondaryContainer, onTertiaryContainer, and onErrorContainer (e.g. FAB, BottomNavigation active tab, SegmentedButton, DrawerItem) — the foreground colors will now render lighter and match the Material Theme Builder output.

Changed files:

  • src/styles/themes/v3/LightTheme.tsxonPrimaryContainer P10→P30, onSecondaryContainer S10→S30, onTertiaryContainer T10→T30, onErrorContainer E10→E30
  • src/styles/themes/v3/DarkTheme.tsxonErrorContainer E80→E90
  • src/components/__tests__/BottomNavigation.test.tsx — updated hardcoded expected color to reflect corrected onSecondaryContainer value
  • 32 component snapshots updated to reflect the corrected color values

@callstack-bot
Copy link
Copy Markdown

Hey @wonderlul, thank you for your pull request 🤗. The documentation from this branch can be viewed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants