Merge branch 'dark' into develop

This commit is contained in:
就眠儀式
2022-03-30 23:11:25 +08:00
77 changed files with 297 additions and 291 deletions

View File

@@ -13,7 +13,7 @@ import {
ButtonSize,
ButtonType,
} from "./interface";
import { BooleanOrString, String } from "src/types";
import { BooleanOrString, String } from "../../types";
export interface LayButtonProps {
type?: ButtonType;

View File

@@ -7,7 +7,7 @@ export default {
<script setup lang="ts">
import { computed, useSlots } from "vue";
import "./index.less";
import { String } from "src/types";
import { String } from "../../types";
import { CardShadow } from "./interface";
const slot = useSlots();

View File

@@ -105,7 +105,7 @@ const handleClick = function () {
:lay-skin="skin"
>
<span v-if="$slots?.default"><slot></slot></span>
<i class="layui-icon layui-icon-ok"></i>
<i :class="{ 'layui-icon layui-icon-ok': isChecked }"></i>
</div>
</span>
</template>

View File

@@ -0,0 +1 @@
export type DatePickerType = "date" | "datetime" | "year" | "time" | "month";

View File

@@ -7,6 +7,11 @@ export default {
<script setup lang="ts">
import { watch } from "vue";
import { useI18n } from "vue-i18n";
import {
enable as enableDarkMode,
disable as disableDarkMode,
} from "darkreader";
const { locale, setLocaleMessage, mergeLocaleMessage } = useI18n();
export interface LayConfigProviderProps {
@@ -34,8 +39,30 @@ const changeLocales = (lang: string, locales: any, merge: boolean) => {
};
const changeTheme = (theme: string) => {
document.body.removeAttribute("lay-theme");
document.body.setAttribute("lay-theme", theme);
if (theme === "dark") {
enableDarkMode(
{
mode: 1,
brightness: 100,
contrast: 90,
sepia: 0,
// darkSchemeTextColor: 'rgba(255, 255, 255, 0.9)',
// darkSchemeBackgroundColor: '#22272E'
},
{
invert: [],
css: ``,
ignoreInlineStyle: [
".layui-colorpicker-trigger-span",
"div.layui-color-picker *",
],
ignoreImageAnalysis: [],
disableStyleSheetsProxy: false,
}
);
} else {
disableDarkMode();
}
};
const changeThemeVariable = (vars: any) => {

View File

@@ -276,7 +276,6 @@ a cite {
text-align: center;
color: @global-primary-color;
font-size: 16px;
box-shadow: 0 1px 2px 0 rgb(0 0 0 / 15%);
}
.layui-layout-left {

View File

@@ -44,10 +44,6 @@
--global-border-radius: 2px;
--global-fore-color: #333;
--global-back-color: #ffffff;
--global-neutral-color-1: #FAFAFA;
--global-neutral-color-2: #F6F6F6;
@@ -63,27 +59,5 @@
--global-neutral-color-7: #cccccc;
--global-neutral-color-8: #c2c2c2;
}
body[lay-theme="dark"] {
--global-fore-color: #ffffff;
--global-back-color: #333;
--global-neutral-color-1: #FAFAFA;
--global-neutral-color-2: #F6F6F6;
--global-neutral-color-3: #eeeeee;
--global-neutral-color-4: #e2e2e2;
--global-neutral-color-5: #dddddd;
--global-neutral-color-6: #d2d2d2;
--global-neutral-color-7: #cccccc;
--global-neutral-color-8: #c2c2c2;
}
}