Browse Source

fix: Menu SubMenu background in dark theme (#25205)

close #25202
pull/25210/head
偏右 4 years ago
committed by GitHub
parent
commit
87d32a7a3d
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/menu/__tests__/__snapshots__/demo.test.js.snap
  2. 7
      components/menu/demo/horizontal.md
  3. 4
      components/menu/demo/theme.md
  4. 1
      components/menu/style/dark.less

2
components/menu/__tests__/__snapshots__/demo.test.js.snap

@ -1156,7 +1156,7 @@ Array [
Option 3 Option 3
</li> </li>
<li <li
class="ant-menu-item ant-menu-item-danger ant-menu-item-only-child" class="ant-menu-item ant-menu-item-only-child"
role="menuitem" role="menuitem"
style="padding-left:48px" style="padding-left:48px"
> >

7
components/menu/demo/horizontal.md

@ -26,14 +26,13 @@ class App extends React.Component {
handleClick = e => { handleClick = e => {
console.log('click ', e); console.log('click ', e);
this.setState({ this.setState({ current: e.key });
current: e.key,
});
}; };
render() { render() {
const { current } = this.state;
return ( return (
<Menu onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal"> <Menu onClick={this.handleClick} selectedKeys={[current]} mode="horizontal">
<Menu.Item key="mail" icon={<MailOutlined />}> <Menu.Item key="mail" icon={<MailOutlined />}>
Navigation One Navigation One
</Menu.Item> </Menu.Item>

4
components/menu/demo/theme.md

@ -61,9 +61,7 @@ class Sider extends React.Component {
<Menu.Item key="1">Option 1</Menu.Item> <Menu.Item key="1">Option 1</Menu.Item>
<Menu.Item key="2">Option 2</Menu.Item> <Menu.Item key="2">Option 2</Menu.Item>
<Menu.Item key="3">Option 3</Menu.Item> <Menu.Item key="3">Option 3</Menu.Item>
<Menu.Item key="4" danger> <Menu.Item key="4">Option 4</Menu.Item>
Option 4
</Menu.Item>
</SubMenu> </SubMenu>
<SubMenu key="sub2" icon={<AppstoreOutlined />} title="Navigation Two"> <SubMenu key="sub2" icon={<AppstoreOutlined />} title="Navigation Two">
<Menu.Item key="5">Option 5</Menu.Item> <Menu.Item key="5">Option 5</Menu.Item>

1
components/menu/style/dark.less

@ -1,6 +1,7 @@
.@{menu-prefix-cls} { .@{menu-prefix-cls} {
// dark theme // dark theme
&&-dark, &&-dark,
&-dark &-sub,
&&-dark &-sub { &&-dark &-sub {
color: @menu-dark-color; color: @menu-dark-color;
background: @menu-dark-bg; background: @menu-dark-bg;

Loading…
Cancel
Save