Repository navigation
fix(react-migration-v8-v9): use webDarkTheme as createV9Theme base for inverted v8 themes - #41
Open
mainframev wants to merge 1 commit into
Open
mainframev wants to merge 1 commit into
mainframev wants to merge 1 commit into
Conversation
…r inverted v8 themes createV9Theme always fell back to webLightTheme, so tokens without a v8 mapping (e.g. status colors) kept light values for dark v8 themes. Fall back to webDarkTheme when themeV8.isInverted is set; an explicit base theme still wins. Fixes microsoft#31728
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.
Previous Behavior
createV9Theme(themeV8)always fell back towebLightThemeas the base v9 theme. Tokens that have no v8 mapping, such as thecolorStatus*tokens, kept their light values even when the v8 theme was dark (isInverted: true). Status colors therefore rendered wrong in dark themes unless the caller passedwebDarkThemeexplicitly.New Behavior
When no base theme is passed,
createV9ThemeuseswebDarkThemefor inverted v8 themes andwebLightThemefor the rest. An explicitly passedbaseThemeV9still takes precedence.Before / after for
createV9Theme(createTheme({ isInverted: true })).colorStatusDangerForeground1:#b10e1cwebLightTheme#dc626dwebDarkThemeAdded
v9ThemeShim.test.tswith light, dark, and explicit-base cases. The dark case fails onmasterand passes with this change.webDarkThemeis now always bundled withcreateV9Theme(flagged in microsoft#31743). This package already imports@fluentui/react-components, so the extra cost is one theme object.This replaces microsoft#31743, which no longer applies after the package moved to
library/.Related Issue(s)