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

Antd dark theme does not work #4267

Open
mathtev opened this issue Feb 27, 2024 · 1 comment
Open

Antd dark theme does not work #4267

mathtev opened this issue Feb 27, 2024 · 1 comment

Comments

@mathtev
Copy link

mathtev commented Feb 27, 2024

Environment

System:

  • OS: Windows 10 10.0.19045
  • CPU: (12) x64 Intel(R) Core(TM) i7-9850H CPU @ 2.60GHz
  • Memory: 11.48 GB / 31.79 GB

Binaries:

  • Node: 18.16.0 - ~\AppData\Local\Volta\tools\image\node\18.16.0\node.EXE
  • npm: 9.6.3 - ~\AppData\Local\Volta\tools\image\npm\9.6.3\bin\npm.CMD

npmPackages:

  • styled-components: 6.1.8 => 6.1.8
  • antd: 5.11.5

Reproduction

After migrating to styled components v6 I cannot use a dark theme for antd Menu even though I am not assigning any additional styles:

  const StyledMenu = styled(Menu)``;

 // as a result I get light theme instead of dark theme
 <StyledMenu
    theme="dark"
    mode="horizontal"
    items={[
      { key: 'form', label: 'Form' },
      { key: 'settings', label: 'Settings' },
    ]}
  />

// When not using styled components dark theme is applied correctly

 <Menu
    theme="dark"
    mode="horizontal"
    items={[
      { key: 'form', label: 'Form' },
      { key: 'settings', label: 'Settings' },
    ]}
  />

Expected Behavior

Using styled-components should not have any side effects like overwriting styles that I did not specify

Actual Behavior

Some styles are overwritten by styled-components

@mathtev
Copy link
Author

mathtev commented Feb 27, 2024

related to: #4182

@mathtev mathtev changed the title Styled components V6 overwriting antd menu dark theme Antd dark theme does not work Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant