Skip to content

feat: add DynamicTheme using PlatformColor#4901

Open
adrcotfas wants to merge 4 commits into@adrcotfas/fix/color_tokensfrom
@adrcotfas/feat/dynamic_theme
Open

feat: add DynamicTheme using PlatformColor#4901
adrcotfas wants to merge 4 commits into@adrcotfas/fix/color_tokensfrom
@adrcotfas/feat/dynamic_theme

Conversation

@adrcotfas
Copy link
Copy Markdown
Collaborator

@adrcotfas adrcotfas commented Apr 15, 2026

Motivation

  • This PR replaces the use of the native moduleExpo Material 3 Theme with a PlatformColor implementation.
    See https://reactnative.dev/docs/platformcolor.
  • State opacity values were updated to the specs; the reference theme elevation colors now use the correct neutral tones. See https://m3.material.io/blog/tone-based-surface-color-m3.
  • Since PlatformColor does not support applying an alpha, certain components like Button or Checkbox requiring this were updated to use opacity instead.
  • Other components using alpha like Chip were updated to use the state layers implementation as per specs.
  • The disabled version 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 using alpha and having this together with PlatformColor is not compatible.
  • surfaceDisabled, onSurfaceDisabled and backdrop which were not part of the MD standard were removed/replaced
  • This PR together with fix(MD3): update color schema and tokens  #4900 are the first steps required to modernize Paper to the latest MD3 specs.

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

* 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
@github-actions
Copy link
Copy Markdown

The mobile version of example app from this branch is ready! You can see it 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.

1 participant