fix(style): dark css vars

This commit is contained in:
jialin
2025-04-28 10:05:06 +08:00
parent 4b748ee43a
commit 96e5398ad1
9 changed files with 55 additions and 17 deletions
+2 -2
View File
@@ -37,7 +37,7 @@ export default function useChartConfig() {
splitLineColor: token.colorBorder,
tickLineColor: token.colorSplit,
axislabelColor: token.colorTextTertiary,
gaugeSplitLineColor: 'rgba(255, 255, 255, 0.38)',
gaugeSplitLineColor: isDarkTheme ? '#b8b8b8' : 'rgba(255, 255, 255, 1)',
colorBgContainerHover: isDarkTheme ? '#424242' : '#fff'
};
}, [userSettings.theme, isDarkTheme]);
@@ -176,7 +176,7 @@ export default function useChartConfig() {
}
},
axisTick: {
distance: -12,
distance: -11,
length: 6,
splitNumber: 5,
lineStyle: {
+1 -1
View File
@@ -36,7 +36,7 @@ const RenderProgress = memo(
return (
<span
style={{
color: '#fff'
color: 'var(--color-progress-text)'
}}
>
{percent}%
@@ -117,11 +117,6 @@ const SelectWrapper = styled.div`
padding-block: 20px 0 !important;
box-shadow: none !important;
&:hover {
border-color: var(--ant-input-hover-border-color) !important;
transition: all 0.2s ease;
}
&:focus-within {
border-color: var(--ant-input-active-border-color) !important;
outline: 0;
+2 -3
View File
@@ -22,7 +22,7 @@
}
&.download {
border: 1px solid #93ecc5 !important;
border: 1px solid var(--ant-color-success-border-hover) !important;
}
.download {
@@ -34,13 +34,12 @@
top: 0;
bottom: 0;
height: 100%;
background-color: #e0f5ec;
background-color: var(--ant-color-success-border);
}
.progress {
position: relative;
z-index: 10;
// color: var(--ant-color-text);
color: var(--ant-color-success);
}
}
+2
View File
@@ -38,6 +38,7 @@ html {
--font-weight-normal: 400;
--font-weight-medium: 600;
--font-weight-bold: 700;
--color-progress-text: rgba(255, 255, 255, 100%);
--color-white-primary: rgba(255, 255, 255, 100%);
--color-white-secondary: rgba(255, 255, 255, 90%);
--color-white-tertiary: rgba(255, 255, 255, 70%);
@@ -91,6 +92,7 @@ html[data-theme='realDark'] {
--color-fill-spin-bg: rgba(55, 55, 55, 50%);
--color-bg-tooltip: #424242;
--color-editor-header-bg: #292929;
--color-progress-text: rgba(255, 255, 255, 80%);
background: #141414;
}
+4 -2
View File
@@ -341,8 +341,10 @@ export const getRightRenderContent = (opts: {
<div>
<Menu {...helpMenu} style={getMenuStyle(collapsed, siderWidth)} />
<Menu {...langMenu} style={getMenuStyle(collapsed, siderWidth)} />
<Menu {...themeMenu} style={getMenuStyle(collapsed, siderWidth)} />
<Menu {...userMenu} style={getMenuStyle(collapsed, siderWidth)} />
<Menu
{...userMenu}
style={getMenuStyle(collapsed, siderWidth, { marginTop: 20 })}
/>
</div>
);
};
@@ -463,6 +463,7 @@ const InstanceItem: React.FC<InstanceItemProps> = ({
return (
<div>
<SimpleTabel
rowKey="worker_name"
columns={distributeCols}
dataSource={[...mainWorker, ...list]}
></SimpleTabel>
@@ -0,0 +1,39 @@
import useUserSettings from '@/hooks/use-user-settings';
import { MoonOutlined, SunOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Radio } from 'antd';
import React from 'react';
const ThemeOptions = [
{
key: 'realDark',
label: 'common.appearance.dark',
icon: <MoonOutlined />
},
{
key: 'light',
label: 'common.appearance.light',
icon: <SunOutlined />
}
];
const Appearance: React.FC = () => {
const { setTheme } = useUserSettings();
const intl = useIntl();
const handleOnChange = (e: any) => {
setTheme(e.target.value);
};
return (
<Radio.Group onChange={handleOnChange} style={{ marginTop: 16 }}>
{ThemeOptions.map((item) => (
<Radio key={item.key} value={item.key}>
{intl.formatMessage({ id: item.label })}
</Radio>
))}
</Radio.Group>
);
};
Appearance.displayName = 'Appearance';
export default Appearance;
+4 -4
View File
@@ -4,7 +4,7 @@ import { useIntl } from '@umijs/max';
import { TabsProps } from 'antd';
import React, { useCallback, useState } from 'react';
import styled from 'styled-components';
import CustomUI from './components/custom-ui';
import Appearance from './components/appearance';
import ModifyPasswordn from './components/modify-password';
const Wrapper = styled.div`
@@ -27,9 +27,9 @@ const Profile: React.FC = () => {
children: <ModifyPasswordn />
},
{
key: 'custom-ui',
label: 'Custom UI',
children: <CustomUI />
key: 'appearance',
label: intl.formatMessage({ id: 'common.appearance' }),
children: <Appearance />
}
];