diff --git a/packages/react-components/react-migration-v8-v9/src/components/Theme/v9ThemeShim.ts b/packages/react-components/react-migration-v8-v9/src/components/Theme/v9ThemeShim.ts index 380bda99116122..0f729315294b79 100644 --- a/packages/react-components/react-migration-v8-v9/src/components/Theme/v9ThemeShim.ts +++ b/packages/react-components/react-migration-v8-v9/src/components/Theme/v9ThemeShim.ts @@ -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'; @@ -203,11 +203,10 @@ const mapBorderRadiusTokens = (effects: IEffects): Partial = /** * Creates a v9 theme from a v8 theme. - * You can optional pass a base v9 theme; otherwise webLightTheme is used. + * You can optional pass a base v9 theme; otherwise webLightTheme or webDarkTheme is used, depending on whether the v8 theme is inverted */ 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),