feat: 新增 global-dark-text-color 与 global-dark-background-color 主题变量
This commit is contained in:
parent
10d404239f
commit
08c2058707
@ -19,7 +19,7 @@ const props = withDefaults(defineProps<LayTimelineProps>(), {
|
|||||||
const timeLineClass = computed(() => [
|
const timeLineClass = computed(() => [
|
||||||
"layui-timeline",
|
"layui-timeline",
|
||||||
props.direction === "horizontal" ? "layui-timeline-horizontal" : "",
|
props.direction === "horizontal" ? "layui-timeline-horizontal" : "",
|
||||||
])
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -46,8 +46,12 @@ const changeTheme = (theme: string) => {
|
|||||||
brightness: 100,
|
brightness: 100,
|
||||||
contrast: 90,
|
contrast: 90,
|
||||||
sepia: 0,
|
sepia: 0,
|
||||||
darkSchemeTextColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-text-color"),
|
darkSchemeTextColor: getComputedStyle(
|
||||||
darkSchemeBackgroundColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-background-color")
|
document.documentElement
|
||||||
|
).getPropertyValue("--global-dark-text-color"),
|
||||||
|
darkSchemeBackgroundColor: getComputedStyle(
|
||||||
|
document.documentElement
|
||||||
|
).getPropertyValue("--global-dark-background-color"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
invert: [],
|
invert: [],
|
||||||
@ -60,10 +64,10 @@ const changeTheme = (theme: string) => {
|
|||||||
disableStyleSheetsProxy: false,
|
disableStyleSheetsProxy: false,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
localStorage.setItem('layui-vue-theme-dark','true')
|
localStorage.setItem("layui-vue-theme-dark", "true");
|
||||||
} else {
|
} else {
|
||||||
disableDarkMode();
|
disableDarkMode();
|
||||||
localStorage.setItem('layui-vue-theme-dark','false')
|
localStorage.setItem("layui-vue-theme-dark", "false");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user