Skip to content

Commit adbf793

Browse files
authored
fix(@vben/web-ele): the main color tone for switching between dark and light themes has been reset (vbenjs#6678)
1 parent cf6c4c9 commit adbf793

File tree

1 file changed

+4
-2
lines changed
  • packages/effects/layouts/src/widgets/preferences/blocks/theme

1 file changed

+4
-2
lines changed

packages/effects/layouts/src/widgets/preferences/blocks/theme/builtin.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ function selectColor() {
104104
105105
watch(
106106
() => [modelValue.value, props.isDark] as [BuiltinThemeType, boolean],
107-
([themeType, isDark]) => {
107+
([themeType, isDark], [_, isDarkPrev]) => {
108108
const theme = builtinThemePresets.value.find(
109109
(item) => item.type === themeType,
110110
);
@@ -113,7 +113,9 @@ watch(
113113
? theme.darkPrimaryColor || theme.primaryColor
114114
: theme.primaryColor;
115115
116-
themeColorPrimary.value = primaryColor || theme.color;
116+
if (!(theme.type === 'custom' && isDark !== isDarkPrev)) {
117+
themeColorPrimary.value = primaryColor || theme.color;
118+
}
117119
}
118120
},
119121
);

0 commit comments

Comments
 (0)