styled-components / styled-components

Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress 💅
https://styled-components.com
MIT License
40.11k stars 2.48k forks source link

Antd dark theme does not work #4267

Open mathtev opened 2 months ago

mathtev commented 2 months ago

Environment

System:

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 commented 2 months ago

related to: https://github.com/styled-components/styled-components/issues/4182