Skip to content

Commit bab53f8

Browse files
committed
feat: add theme style setting (bg color)
1 parent 65cc1d1 commit bab53f8

2 files changed

Lines changed: 53 additions & 44 deletions

File tree

web/src/components/Index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,9 @@ const siteTitle = computed(() => {
327327
<template>
328328
<router-view v-if="!isAuthenticated || route.path == '/login' || route.path == 'login'"></router-view>
329329

330-
<div class="min-h-screen bg-background" v-else>
330+
<div class="min-h-screen" v-else>
331331
<!-- 顶部导航栏 -->
332-
<nav class="bg-background shadow-sm border-b border-border">
332+
<nav class="bg-background/80 backdrop-blur-md sticky top-0 shadow-sm border-b border-border z-40">
333333
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
334334
<div class="flex justify-between items-center h-16">
335335
<!-- Logo/品牌名称 -->

web/src/index.css

Lines changed: 51 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -45,54 +45,51 @@
4545
}
4646

4747
:root {
48-
--background: oklch(0.99 0.005 260);
49-
/* 精致的冷色调背景 */
50-
--foreground: oklch(0.15 0.02 260);
48+
--background: oklch(1 0 0);
49+
--foreground: oklch(0.145 0 0);
5150
--card: oklch(1 0 0);
52-
--card-foreground: oklch(0.15 0.02 260);
51+
--card-foreground: oklch(0.145 0 0);
5352
--popover: oklch(1 0 0);
54-
--popover-foreground: oklch(0.15 0.02 260);
55-
--primary: oklch(0.25 0.02 260);
56-
--primary-foreground: oklch(0.98 0.01 260);
57-
--secondary: oklch(0.96 0.01 260);
58-
--secondary-foreground: oklch(0.25 0.02 260);
59-
--muted: oklch(0.96 0.01 260);
60-
--muted-foreground: oklch(0.45 0.02 260);
61-
--accent: oklch(0.96 0.01 260);
62-
--accent-foreground: oklch(0.25 0.02 260);
63-
--destructive: oklch(0.55 0.18 25);
64-
--destructive-foreground: oklch(0.98 0.01 260);
65-
--border: oklch(0.92 0.01 260);
66-
--input: oklch(0.92 0.01 260);
67-
--ring: oklch(0.7 0.1 260);
53+
--popover-foreground: oklch(0.145 0 0);
54+
--primary: oklch(0.205 0 0);
55+
--primary-foreground: oklch(0.985 0 0);
56+
--secondary: oklch(0.97 0 0);
57+
--secondary-foreground: oklch(0.205 0 0);
58+
--muted: oklch(0.97 0 0);
59+
--muted-foreground: oklch(0.556 0 0);
60+
--accent: oklch(0.97 0 0);
61+
--accent-foreground: oklch(0.205 0 0);
62+
--destructive: oklch(0.577 0.245 27.325);
63+
--destructive-foreground: oklch(0.985 0 0);
64+
--border: oklch(0.922 0 0);
65+
--input: oklch(0.922 0 0);
66+
--ring: oklch(0.708 0 0);
6867
--radius: 0.75rem;
69-
/* 更圆润的视觉 */
7068

7169
--brand: oklch(0.55 0.18 260);
72-
--brand-foreground: oklch(0.98 0.01 260);
70+
--brand-foreground: oklch(0.985 0 0);
7371
}
7472

7573
.dark {
76-
--background: oklch(0.14 0.01 260);
77-
/* 极简深色背景 */
78-
--foreground: oklch(0.95 0.01 260);
79-
--card: oklch(0.16 0.01 260);
80-
--card-foreground: oklch(0.95 0.01 260);
81-
--popover: oklch(0.16 0.01 260);
82-
--popover-foreground: oklch(0.95 0.01 260);
83-
--primary: oklch(0.95 0.01 260);
84-
--primary-foreground: oklch(0.15 0.02 260);
85-
--secondary: oklch(0.25 0.02 260);
86-
--secondary-foreground: oklch(0.95 0.01 260);
87-
--muted: oklch(0.22 0.02 260);
88-
--muted-foreground: oklch(0.65 0.02 260);
89-
--accent: oklch(0.25 0.02 260);
90-
--accent-foreground: oklch(0.95 0.01 260);
91-
--destructive: oklch(0.45 0.18 25);
92-
--destructive-foreground: oklch(0.95 0.01 260);
93-
--border: oklch(0.28 0.02 260);
94-
--input: oklch(0.28 0.02 260);
95-
--ring: oklch(0.7 0.1 260);
74+
--background: oklch(0.145 0 0);
75+
--foreground: oklch(0.985 0 0);
76+
--card: oklch(0.145 0 0);
77+
--card-foreground: oklch(0.985 0 0);
78+
--popover: oklch(0.145 0 0);
79+
--popover-foreground: oklch(0.985 0 0);
80+
--primary: oklch(0.985 0 0);
81+
--primary-foreground: oklch(0.145 0 0);
82+
--secondary: oklch(0.205 0 0);
83+
--secondary-foreground: oklch(0.985 0 0);
84+
--muted: oklch(0.205 0 0);
85+
--muted-foreground: oklch(0.708 0 0);
86+
--accent: oklch(0.205 0 0);
87+
--accent-foreground: oklch(0.985 0 0);
88+
--destructive: oklch(0.396 0.141 25.723);
89+
--destructive-foreground: oklch(0.985 0 0);
90+
--border: oklch(0.205 0 0);
91+
--input: oklch(0.205 0 0);
92+
--ring: oklch(0.439 0 0);
9693
}
9794

9895
@layer base {
@@ -101,13 +98,25 @@
10198
}
10299

103100
body {
104-
@apply bg-background text-foreground antialiased;
101+
@apply bg-background text-foreground antialiased min-h-screen relative;
105102
font-feature-settings: "cv02", "cv03", "cv04", "cv11";
103+
104+
/* 极致背景装饰:极简动态柔和渐变 */
105+
background-image:
106+
radial-gradient(at 0% 0%, color-mix(in oklch, var(--brand), transparent 94%) 0px, transparent 50%),
107+
radial-gradient(at 100% 0%, color-mix(in oklch, var(--brand), transparent 97%) 0px, transparent 50%);
108+
background-attachment: fixed;
109+
}
110+
111+
.dark body {
112+
background-image:
113+
radial-gradient(at 0% 0%, color-mix(in oklch, var(--brand), transparent 92%) 0px, transparent 50%),
114+
radial-gradient(at 100% 0%, color-mix(in oklch, var(--brand), transparent 95%) 0px, transparent 50%);
106115
}
107116

108117
/* 品牌色交互组件增强 */
109118
.btn-brand-premium {
110-
@apply bg-brand text-brand-foreground shadow-[0_4px_12px_rgba(var(--brand), 0.3)] hover:shadow-[0_6px_20px_rgba(var(--brand), 0.4)] hover:-translate-y-0.5 active:translate-y-0 transition-all duration-300;
119+
@apply bg-brand text-brand-foreground shadow-md hover:shadow-xl hover:-translate-y-0.5 active:translate-y-0 transition-all duration-300;
111120
}
112121
}
113122

0 commit comments

Comments
 (0)