feat: add DynamicTheme using PlatformColor#4901
Open
adrcotfas wants to merge 4 commits into@adrcotfas/fix/color_tokensfrom
Open
feat: add DynamicTheme using PlatformColor#4901adrcotfas wants to merge 4 commits into@adrcotfas/fix/color_tokensfrom
adrcotfas wants to merge 4 commits into@adrcotfas/fix/color_tokensfrom
Conversation
* Known limitation: surface/container roles on API 31-33 use * @color/m3_ref_palette_dynamic_neutral_variant* (MCL resources that require a * native DynamicColors setup). No @android:color/ equivalent exists for those * slots. Reference palette values are used as fallback on API 31-33.
for PlatformColor compatibility * surfaceDisabled, onSurfaceDisabled and backdrop which were not part of the MD standard were removed * the reference theme elevation colors now use the correct neutral tones; see https://m3.material.io/blog/tone-based-surface-color-m3 * replace usage of "alpha" with opacity or surface colors * remove disabled FAB prop
This was referenced Apr 15, 2026
|
The mobile version of example app from this branch is ready! You can see it 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
Expo Material 3 Themewith aPlatformColorimplementation.See https://reactnative.dev/docs/platformcolor.
PlatformColordoes not support applying an alpha, certain components likeButtonorCheckboxrequiring this were updated to useopacityinstead.alphalikeChipwere updated to use the state layers implementation as per specs.disabledversion of the FAB was removed for two reasons: 1. MD3 specs state that a FAB does not have a disabled state and should be hidden instead; 2. It was usingalphaand having this together withPlatformColoris not compatible.surfaceDisabled,onSurfaceDisabledandbackdropwhich were not part of the MD standard were removed/replacedOrder of merging:
Related issue
#4893
Test plan
Run the Example app, enable Dynamic Colors from the drawer and switch the system theme: observe the app adapting to the device theme.