fix: default theme colors cannot be overridden (#4636)
* fix: default theme colors cannot be overridden * chore: update default configpull/48/MERGE
parent
6c4a742627
commit
d5a210f53f
|
@ -93,7 +93,7 @@ exports[`defaultPreferences immutability test > should not modify the config obj
|
||||||
"mode": "dark",
|
"mode": "dark",
|
||||||
"radius": "0.5",
|
"radius": "0.5",
|
||||||
"semiDarkHeader": false,
|
"semiDarkHeader": false,
|
||||||
"semiDarkSidebar": true,
|
"semiDarkSidebar": false,
|
||||||
},
|
},
|
||||||
"transition": {
|
"transition": {
|
||||||
"enable": true,
|
"enable": true,
|
||||||
|
|
|
@ -82,7 +82,6 @@ const defaultPreferences: Preferences = {
|
||||||
showIcon: true,
|
showIcon: true,
|
||||||
showMaximize: true,
|
showMaximize: true,
|
||||||
showMore: true,
|
showMore: true,
|
||||||
|
|
||||||
styleType: 'chrome',
|
styleType: 'chrome',
|
||||||
},
|
},
|
||||||
theme: {
|
theme: {
|
||||||
|
@ -94,7 +93,7 @@ const defaultPreferences: Preferences = {
|
||||||
mode: 'dark',
|
mode: 'dark',
|
||||||
radius: '0.5',
|
radius: '0.5',
|
||||||
semiDarkHeader: false,
|
semiDarkHeader: false,
|
||||||
semiDarkSidebar: true,
|
semiDarkSidebar: false,
|
||||||
},
|
},
|
||||||
transition: {
|
transition: {
|
||||||
enable: true,
|
enable: true,
|
||||||
|
|
|
@ -18,7 +18,7 @@ function updateCSSVariables(preferences: Preferences) {
|
||||||
|
|
||||||
const theme = preferences?.theme ?? {};
|
const theme = preferences?.theme ?? {};
|
||||||
|
|
||||||
const { builtinType, colorPrimary, mode, radius } = theme;
|
const { builtinType, mode, radius } = theme;
|
||||||
|
|
||||||
// html 设置 dark 类
|
// html 设置 dark 类
|
||||||
if (Reflect.has(theme, 'mode')) {
|
if (Reflect.has(theme, 'mode')) {
|
||||||
|
@ -58,7 +58,7 @@ function updateCSSVariables(preferences: Preferences) {
|
||||||
Reflect.has(theme, 'colorSuccess') ||
|
Reflect.has(theme, 'colorSuccess') ||
|
||||||
Reflect.has(theme, 'colorWarning')
|
Reflect.has(theme, 'colorWarning')
|
||||||
) {
|
) {
|
||||||
preferences.theme.colorPrimary = builtinTypeColorPrimary || colorPrimary;
|
// preferences.theme.colorPrimary = builtinTypeColorPrimary || colorPrimary;
|
||||||
updateMainColorVariables(preferences);
|
updateMainColorVariables(preferences);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue