Repository navigation
Set the media features from the iOS and Android color scheme - #60125
Open
intergalacticspacehighway wants to merge 1 commit into
Open
intergalacticspacehighway wants to merge 1 commit into
intergalacticspacehighway wants to merge 1 commit into
Conversation
This was referenced Nov 18, 2026
intergalacticspacehighway
force-pushed
the
media-queries-2-platforms
branch
from
November 18, 2026 18:25
d69aa7d to
075557d
Compare
intergalacticspacehighway
force-pushed
the
media-queries-2-platforms
branch
2 times, most recently
from
November 19, 2026 04:27
7941f82 to
549754e
Compare
intergalacticspacehighway
marked this pull request as ready for review
November 19, 2026 05:18
intergalacticspacehighway
force-pushed
the
media-queries-2-platforms
branch
from
November 19, 2026 05:22
549754e to
dc0086b
Compare
This branch has not been deployed
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.
Summary:
This is PR 2 of 3 (RFC). Stack: #60124 (core) → this PR → #60126 (types and example).
This PR connects the platform color scheme to the media features from PR 1. On both platforms, the first value is set before the first surface starts, so the first render already uses it. Each later change calls
setMediaFeatures, which commits each surface. Conditional styles use the same color scheme asuseColorScheme(), including the app's overrides.RCTSurfacePresentersends the color scheme to Fabric (-[RCTScheduler setMediaFeatures:]): once at start, then on eachRCTUserInterfaceStyleDidChangeNotification.RCTColorSchemePreference, the same function asRCTAppearance, so the app's appearance settings (such asRCTOverrideAppearancePreference) apply.RCTColorSchemePreferencemoves unchanged from React-CoreModules to React-Core (React/Modules/RCTAppearancePreference), so Fabric needs no new pod dependency. This is the same split asRCTI18nUtil.RCTAppearance.himports the new header, so existing imports still work.uiMode.AppearanceModulesends each new color scheme, including the app'sOverrideColorScheme, to the newFabricUIManager.setMediaFeatures(@UnstableReactNativeAPI).Appearance.setColorScheme()works on both platforms, because it changes the window style (iOS) or the activity configuration (Android).Changelog:
[IOS] [ADDED] - Conditional style values follow the color scheme.
[ANDROID] [ADDED] - Conditional style values follow the color scheme.
Test Plan:
gh pr checkout 60126(includes all 3 PRs), build RNTester on Android and iOS, and open Media Queries.Appearance.setColorScheme(), and native overrides (OverrideColorScheme,RCTOverrideAppearancePreference) with no React render, and matchuseColorScheme().