Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Ensure createV9Theme uses appropriate base theme for dark theme #31743

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Theme as ThemeV8 } from '@fluentui/react';
import type { IEffects, IPalette } from '@fluentui/react';
import { Theme as ThemeV9, webLightTheme } from '@fluentui/react-components';
import { Theme as ThemeV9, webLightTheme, webDarkTheme } from '@fluentui/react-components';
import type { BorderRadiusTokens, ColorTokens, ShadowTokens } from '@fluentui/react-components';
import { blackAlpha, whiteAlpha, grey, grey10Alpha, grey12Alpha } from './themeDuplicates';

Expand Down Expand Up @@ -206,8 +206,7 @@ const mapBorderRadiusTokens = (effects: IEffects): Partial<BorderRadiusTokens> =
* You can optional pass a base v9 theme; otherwise webLightTheme is used.
*/
export const createV9Theme = (themeV8: ThemeV8, baseThemeV9?: ThemeV9): ThemeV9 => {
const baseTheme = baseThemeV9 ?? webLightTheme;

const baseTheme = baseThemeV9 ?? (themeV8.isInverted ? webDarkTheme : webLightTheme);
return {
...baseTheme,
...mapAliasColors(themeV8.palette, themeV8.isInverted),
Expand Down
Loading