fix: update MD3 default theme color tokens#4886
Open
wonderlul wants to merge 1 commit intocallstack:mainfrom
Open
fix: update MD3 default theme color tokens#4886wonderlul wants to merge 1 commit intocallstack:mainfrom
wonderlul wants to merge 1 commit intocallstack:mainfrom
Conversation
|
Hey @wonderlul, thank you for your pull request 🤗. The documentation from this branch can be viewed here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
The default MD3 light theme had incorrect tonal mappings for
onContainercolor 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
onErrorContainerin 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
yarn test— all tests pass after snapshot updates and a correction to the hardcoded expected color value inBottomNavigation.test.tsx.onPrimaryContainer,onSecondaryContainer,onTertiaryContainer, andonErrorContainer(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.tsx—onPrimaryContainerP10→P30,onSecondaryContainerS10→S30,onTertiaryContainerT10→T30,onErrorContainerE10→E30src/styles/themes/v3/DarkTheme.tsx—onErrorContainerE80→E90src/components/__tests__/BottomNavigation.test.tsx— updated hardcoded expected color to reflect correctedonSecondaryContainervalue