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

[Bug]: CreateV9Theme cannot support some token in dark theme #31728

Open
2 tasks done
wenyaojinMS opened this issue Jun 17, 2024 · 1 comment · May be fixed by #31743
Open
2 tasks done

[Bug]: CreateV9Theme cannot support some token in dark theme #31728

wenyaojinMS opened this issue Jun 17, 2024 · 1 comment · May be fixed by #31743

Comments

@wenyaojinMS
Copy link

Library

React Components / v9 (@fluentui/react-components)

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 11th Gen Intel(R) Core(TM) i5-11260H @ 2.60GHz
    Memory: 11.29 GB / 23.73 GB
  Browsers:
    Edge: Chromium (125.0.2535.92)
    Internet Explorer: 11.0.22621.3527

Are you reporting Accessibility issue?

None

Reproduction

https://stackblitz.com/edit/gpzfuq?file=src%2FApp.tsx,package.json,src%2Fexample.tsx

Bug Description

Actual Behavior

CreateV9Theme function can only support some tokens in dark theme. For status tokens, there is no mapping between V8 and V9. Even in the dark theme, the token value will come from webLightTheme, so that some colors are wrong in dark theme.
image

image

Expected Behavior

fill this out

Logs

No response

Requested priority

Blocking

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@miroslavstastny
Copy link
Member

createv9Theme() accepts the base v9 theme as the second argument. In your example, pass webDarkTheme to the function:

import { FluentProvider, webDarkTheme } from '@fluentui/react-components';
import { createV9Theme as createFluentV9Theme } from '@fluentui/react-migration-v8-v9';
import { DarkTheme } from '@fluentui/theme-samples';

//...

return <FluentProvider theme={createFluentV9Theme(DarkTheme, webDarkTheme)} />

The createv9Theme() should do that internally based on themeV8.isInverted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants