feat: 新增 global-dark-text-color 与 global-dark-background-color 主题变量
This commit is contained in:
parent
4ada2ac9b5
commit
10d404239f
@ -11,6 +11,17 @@
|
|||||||
<template>
|
<template>
|
||||||
<lay-timeline>
|
<lay-timeline>
|
||||||
<lay-timeline-item title="1.0.x">
|
<lay-timeline-item title="1.0.x">
|
||||||
|
<ul>
|
||||||
|
<a name="1-0-1"> </a>
|
||||||
|
<li>
|
||||||
|
<h3>1.0.1 <span class="layui-badge-rim">2022-04-03</span></h3>
|
||||||
|
<ul>
|
||||||
|
<li>[新增] timeline 组件 direction 属性, 支持垂直与水平布局。</li>
|
||||||
|
<li>[新增] config-proivder 组件 global-dark-background-color 夜间模式背景颜色变量。</li>
|
||||||
|
<li>[新增] config-proivder 组件 global-dark-text-color 夜间模式文字颜色变量。</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<ul>
|
<ul>
|
||||||
<a name="1-0-0"> </a>
|
<a name="1-0-0"> </a>
|
||||||
<li>
|
<li>
|
||||||
|
@ -109,7 +109,15 @@
|
|||||||
<lay-color-picker
|
<lay-color-picker
|
||||||
v-model="themeVariable['--global-neutral-color-8']"
|
v-model="themeVariable['--global-neutral-color-8']"
|
||||||
></lay-color-picker>
|
></lay-color-picker>
|
||||||
<lay-button fluid>导 出 配 置</lay-button>
|
<lay-color-picker
|
||||||
|
v-model="themeVariable['--global-dark-text-color']"
|
||||||
|
></lay-color-picker
|
||||||
|
>
|
||||||
|
<lay-color-picker
|
||||||
|
v-model="themeVariable['--global-dark-background-color']"
|
||||||
|
></lay-color-picker>
|
||||||
|
|
||||||
|
<lay-button fluid="true">导 出 配 置</lay-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</lay-dropdown>
|
</lay-dropdown>
|
||||||
@ -231,6 +239,7 @@ export default {
|
|||||||
];
|
];
|
||||||
let isDark = (localStorage.getItem('layui-vue-theme-dark') !== "false") ||
|
let isDark = (localStorage.getItem('layui-vue-theme-dark') !== "false") ||
|
||||||
window.matchMedia('prefers-color-scheme: dark').matches;
|
window.matchMedia('prefers-color-scheme: dark').matches;
|
||||||
|
|
||||||
const theme = ref(isDark ? "dark":"light");
|
const theme = ref(isDark ? "dark":"light");
|
||||||
const themeVariable = ref({
|
const themeVariable = ref({
|
||||||
"--global-primary-color": "#009688",
|
"--global-primary-color": "#009688",
|
||||||
@ -247,6 +256,8 @@ export default {
|
|||||||
"--global-neutral-color-6": "#d2d2d2",
|
"--global-neutral-color-6": "#d2d2d2",
|
||||||
"--global-neutral-color-7": "#cccccc",
|
"--global-neutral-color-7": "#cccccc",
|
||||||
"--global-neutral-color-8": "#c2c2c2",
|
"--global-neutral-color-8": "#c2c2c2",
|
||||||
|
"--global-dark-text-color": "#FFFFFFc9",
|
||||||
|
"--global-dark-background-color": "#22272E",
|
||||||
});
|
});
|
||||||
|
|
||||||
const menus = [];
|
const menus = [];
|
||||||
|
@ -46,8 +46,8 @@ const changeTheme = (theme: string) => {
|
|||||||
brightness: 100,
|
brightness: 100,
|
||||||
contrast: 90,
|
contrast: 90,
|
||||||
sepia: 0,
|
sepia: 0,
|
||||||
// darkSchemeTextColor: 'rgba(255, 255, 255, 0.9)',
|
darkSchemeTextColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-text-color"),
|
||||||
// darkSchemeBackgroundColor: '#22272E'
|
darkSchemeBackgroundColor: getComputedStyle(document.documentElement).getPropertyValue("--global-dark-background-color")
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
invert: [],
|
invert: [],
|
||||||
|
@ -60,4 +60,8 @@
|
|||||||
|
|
||||||
--global-neutral-color-8: #c2c2c2;
|
--global-neutral-color-8: #c2c2c2;
|
||||||
|
|
||||||
|
--global-dark-text-color: #FFFFFFc9;
|
||||||
|
|
||||||
|
--global-dark-background-color: #22272E;
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user