style: 统一内容区卡片、表单和对话框排版
This commit is contained in:
+65
-24
@@ -10,6 +10,7 @@ const palette = computed(() => isDark.value
|
||||
|
||||
watch(palette, (value) => {
|
||||
const root = document.documentElement;
|
||||
const dark = isDark.value;
|
||||
root.style.setProperty("--bg", value.bg);
|
||||
root.style.setProperty("--panel", value.panel);
|
||||
root.style.setProperty("--ink", value.ink);
|
||||
@@ -18,32 +19,72 @@ watch(palette, (value) => {
|
||||
root.style.setProperty("--accent", value.accent);
|
||||
root.style.setProperty("--sidebar", value.sidebar);
|
||||
root.style.setProperty("--danger", value.danger);
|
||||
root.style.setProperty("--accent-soft", isDark.value ? "rgba(121, 192, 255, 0.16)" : "rgba(9, 105, 218, 0.12)");
|
||||
root.dataset.theme = isDark.value ? "dark" : "light";
|
||||
root.style.setProperty("--ok", dark ? "#3FB950" : "#1A7F37");
|
||||
root.style.setProperty("--panel-2", dark ? "#1C2129" : "#F3F5F7");
|
||||
root.style.setProperty("--hover", dark ? "rgba(230, 237, 243, 0.04)" : "rgba(13, 17, 23, 0.03)");
|
||||
root.style.setProperty("--shadow", dark ? "none" : "0 1px 2px rgba(13, 17, 23, 0.04)");
|
||||
root.style.setProperty("--accent-soft", dark ? "rgba(121, 192, 255, 0.16)" : "rgba(9, 105, 218, 0.12)");
|
||||
root.dataset.theme = dark ? "dark" : "light";
|
||||
}, { immediate: true });
|
||||
|
||||
const overrides = computed<GlobalThemeOverrides>(() => ({
|
||||
common: {
|
||||
primaryColor: "#1F6FEB",
|
||||
primaryColorHover: "#388BFD",
|
||||
primaryColorPressed: "#1158C7",
|
||||
primaryColorSuppl: "#1F6FEB",
|
||||
bodyColor: palette.value.bg,
|
||||
cardColor: palette.value.panel,
|
||||
textColor2: palette.value.ink,
|
||||
textColor3: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
placeholderColor: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
borderColor: isDark.value ? "#6E7681" : "#D0D7DE",
|
||||
fontFamily: '"Segoe UI", "Microsoft YaHei", sans-serif',
|
||||
borderRadius: "3px",
|
||||
},
|
||||
Input: {
|
||||
placeholderColor: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
border: isDark.value ? "1px solid #6E7681" : "1px solid #D0D7DE",
|
||||
borderHover: isDark.value ? "1px solid #C9D1D9" : "1px solid #57606A",
|
||||
borderFocus: "1px solid #1F6FEB",
|
||||
},
|
||||
}));
|
||||
const overrides = computed<GlobalThemeOverrides>(() => {
|
||||
const line = isDark.value ? "#6E7681" : "#D0D7DE";
|
||||
const lineHover = isDark.value ? "#C9D1D9" : "#57606A";
|
||||
return {
|
||||
common: {
|
||||
primaryColor: "#1F6FEB",
|
||||
primaryColorHover: "#388BFD",
|
||||
primaryColorPressed: "#1158C7",
|
||||
primaryColorSuppl: "#1F6FEB",
|
||||
bodyColor: palette.value.bg,
|
||||
cardColor: palette.value.panel,
|
||||
modalColor: palette.value.panel,
|
||||
popoverColor: palette.value.panel,
|
||||
textColor2: palette.value.ink,
|
||||
textColor3: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
placeholderColor: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
borderColor: line,
|
||||
fontFamily: '"Segoe UI", "Microsoft YaHei", sans-serif',
|
||||
borderRadius: "4px",
|
||||
heightMedium: "34px",
|
||||
heightSmall: "28px",
|
||||
},
|
||||
Button: {
|
||||
heightMedium: "34px",
|
||||
heightSmall: "28px",
|
||||
paddingMedium: "0 14px",
|
||||
paddingSmall: "0 10px",
|
||||
fontWeightStrong: "600",
|
||||
borderRadiusMedium: "4px",
|
||||
},
|
||||
Input: {
|
||||
heightMedium: "34px",
|
||||
placeholderColor: isDark.value ? "#C9D1D9" : "#57606A",
|
||||
border: `1px solid ${line}`,
|
||||
borderHover: `1px solid ${lineHover}`,
|
||||
borderFocus: "1px solid #1F6FEB",
|
||||
},
|
||||
InternalSelection: {
|
||||
heightMedium: "34px",
|
||||
border: `1px solid ${line}`,
|
||||
borderHover: `1px solid ${lineHover}`,
|
||||
borderActive: "1px solid #1F6FEB",
|
||||
borderFocus: "1px solid #1F6FEB",
|
||||
},
|
||||
Dialog: {
|
||||
borderRadius: "8px",
|
||||
titleFontSize: "16px",
|
||||
titleFontWeight: "650",
|
||||
padding: "20px 24px 16px",
|
||||
},
|
||||
Card: {
|
||||
borderRadius: "8px",
|
||||
paddingMedium: "20px 24px",
|
||||
titleFontSizeMedium: "16px",
|
||||
titleFontWeight: "650",
|
||||
},
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
Reference in New Issue
Block a user