Add appearance-aware Flex theme sources - #4295
Merged
Merged
Conversation
Contributor
Bundle size reportTree-shaken production Metro bundles. Component costs are relative to their platform shell; shell costs are absolute.
The job is advisory: size changes are reported but do not fail the pull request. Bundle or analysis errors still fail. |
Anandraj (mganandraj)
approved these changes
Aug 31, 2026
…tive into user/jasonvmo/flex-themes
Jason Morse (JasonVMo)
enabled auto-merge (squash)
August 31, 2026 16:00
This was referenced Aug 31, 2026
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.
Platforms Impacted
Description of changes
Adds an appearance-aware theming source model that supports both Flex-first and legacy Fluent theme authoring while keeping
useThemeState()as the sole modern consumption API.FlexThemeReference, structured requested/resolved appearance axes, and stable theme-state/token identity keyed by source revision and resolved appearance.ThemeProvideraround a unified external-store source contract. Nested raw legacy themes and source providers resolve through one effective boundary without mutating author-owned theme or token objects.ThemeReference,ThemeProvider,ThemeContext, anduseThemeAPIs compatible. Legacy-to-Flex conversion is loaded only for modern consumers of legacy sources, while Flex-to-legacy conversion and complete legacy defaults are loaded only when legacyuseThemeconsumers request them.useFlexTokensAPI; modern consumers readuseThemeState().tokens.ThemeState.appearance.The Win32 adapter now consumes structured native
colorSchemeandisHighContrastvalues when available and preserves event-maintained state across subscribers. The current Office native contract has no synchronous current-state getter, so a host change while no consumer is subscribed cannot be recovered until a later event; host-theme string inference remains as a transitional fallback.Fixes #4264
Addresses #4270
Verification
yarn buildyarn lint-repoyarn lage lintyarn lage testyarn workspace @fluentui-react-native/design check:mappingsyarn check-publishingyarn change:checkThemeobjects, and appearance/high-contrast state is represented inconsistently.Pull request checklist
This PR has considered (when applicable):