Skip to content

Commit

Permalink
fix: basic-layouts 页面适应dark light配色
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenlingasMx committed Jun 8, 2023
1 parent 6802210 commit 15c9c02
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/antdp-ui/src/ButtonGroupPro/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.antdp-ButtonGroup{
background: #fff;
/* background: #fff; */
}
.antdp-ButtonGroup .ant-btn{
margin: 0px 12px 0px 0px;
Expand Down
2 changes: 1 addition & 1 deletion packages/basic-layouts/src/Sider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Sider = (props: SiderProps) => {
defaultSelectedKeys={[location.pathname]}
defaultOpenKeys={[location.pathname]}
mode="inline"
theme={theme}
// theme={theme}
items={items}
style={{ width: '100%' }}
/>
Expand Down
10 changes: 7 additions & 3 deletions packages/basic-layouts/src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ body {
--primary-content-bg: #f5f5f5;
}
.antdp-basic-layouts-dark{
--primary-slider-bg: #001529;
--primary-header-bg: #001529;
--primary-slider-bg: #1d1d1d;
--primary-header-bg: #1d1d1d;
--primary-shadow: #001529;
--primary-slider-trigger-border:#fff;
--primary-text-color:#fff;
--primary-content-bg: #f5f5f5;
--primary-content-bg: #1d1d1d;
}
.antdp-basic-layouts {
width: 100%;
Expand All @@ -43,6 +43,10 @@ body {
float: left;
}
}
.ant-menu-dark {
color: rgba(255, 255, 255, 0.65);
background: var(--primary-slider-bg);
}
.antdp-basic-layouts-header {
padding: 0 !important;
margin: 0;
Expand Down
13 changes: 10 additions & 3 deletions packages/basic-layouts/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthorizedConfigProvider } from '@antdp/authorized';
import { App, ConfigProvider, Layout } from 'antd';
import { App, ConfigProvider, Layout, theme as th } from 'antd';
import React, { useMemo } from 'react';
import WarpContent from './Content';
import Header from './Header';
Expand Down Expand Up @@ -107,8 +107,15 @@ const BasicLayouts = (props: BasicLayoutsProps) => {
return (
<AuthorizedConfigProvider {...newData}>
<LayoutsProvider {...props}>
<ConfigProvider {...props.configProviderProps}>
<Layout className={`antdp-basic-layouts ${props.className} antdp-basic-layouts-${theme}`}>
<ConfigProvider
theme={{
algorithm:theme === 'dark' ? th.darkAlgorithm : th.defaultAlgorithm,
}}
{...props.configProviderProps}
>
<Layout
className={`antdp-basic-layouts ${props.className} antdp-basic-layouts-${theme}`}
>
{render}
</Layout>
</ConfigProvider>
Expand Down

0 comments on commit 15c9c02

Please sign in to comment.