Commit d1e0e8bcea1c168631222989969e14f7d0d1b6a4

Authored by 无木
1 parent d3f08e37

fix(dark-theme): fixed `TreeSelect` & `DatePicker` theme

修复黑暗主题下的组件样式

fixed: #955
build/vite/plugin/theme.ts
... ... @@ -33,8 +33,10 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
33 33 return s;
34 34 case '.ant-steps-item-icon > .ant-steps-icon':
35 35 return s;
  36 + case '.ant-select-item-option-selected:not(.ant-select-item-option-disabled)':
  37 + return s;
36 38 }
37   - return `[data-theme] ${s}`;
  39 + return s.startsWith('[data-theme') ? s : `[data-theme] ${s}`;
38 40 },
39 41 colorVariables: [...getThemeColors(), ...colors],
40 42 }),
... ... @@ -49,6 +51,7 @@ export function configThemePlugin(isBuild: boolean): Plugin[] {
49 51 darkModifyVars: {
50 52 ...generateModifyVars(true),
51 53 'text-color': '#c9d1d9',
  54 + 'primary-1': 'rgb(255 255 255 / 8%)',
52 55 'text-color-base': '#c9d1d9',
53 56 'component-background': '#151515',
54 57 'heading-color': 'rgb(255 255 255 / 65%)',
... ...
src/design/theme.less
... ... @@ -37,4 +37,12 @@ html[data-theme='light'] {
37 37 box-shadow: 1px 0 0 0 #434343, 0 1px 0 0 #434343, 1px 1px 0 0 #434343, 1px 0 0 0 #434343 inset,
38 38 0 1px 0 0 #434343 inset;
39 39 }
  40 +
  41 + .ant-calendar-selected-day .ant-calendar-date {
  42 + color: rgba(0, 0, 0, 0.8);
  43 + }
  44 +
  45 + .ant-select-tree li .ant-select-tree-node-content-wrapper.ant-select-tree-node-selected {
  46 + color: rgba(0, 0, 0, 0.9);
  47 + }
40 48 }
... ...