Skip to content

Commit 11dab35

Browse files
committed
feat: dark theme
1 parent 687f37c commit 11dab35

File tree

2 files changed

+47
-8
lines changed

2 files changed

+47
-8
lines changed

packages/hexon-web/src/components/HButton.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const styleVars = computed(() => {
3333
case "primary":
3434
return {
3535
bgColor: theme.value.color.primary.n,
36-
color: theme.value.color.foreground.min,
36+
color: theme.value.color.white,
3737
hoverBgColor: theme.value.color.primary.l2,
3838
activeBgColor: theme.value.color.primary.l4,
3939
invertedColor: theme.value.color.primary.n,
@@ -44,7 +44,7 @@ const styleVars = computed(() => {
4444
case "success":
4545
return {
4646
bgColor: theme.value.color.success.n,
47-
color: theme.value.color.foreground.min,
47+
color: theme.value.color.white,
4848
hoverBgColor: theme.value.color.success.l2,
4949
activeBgColor: theme.value.color.success.l4,
5050
invertedColor: theme.value.color.success.n,
@@ -55,7 +55,7 @@ const styleVars = computed(() => {
5555
case "error":
5656
return {
5757
bgColor: theme.value.color.error.n,
58-
color: theme.value.color.foreground.min,
58+
color: theme.value.color.white,
5959
hoverBgColor: theme.value.color.error.l2,
6060
activeBgColor: theme.value.color.error.l4,
6161
invertedColor: theme.value.color.error.n,
@@ -66,7 +66,7 @@ const styleVars = computed(() => {
6666
case "warning":
6767
return {
6868
bgColor: theme.value.color.warning.n,
69-
color: theme.value.color.foreground.min,
69+
color: theme.value.color.white,
7070
hoverBgColor: theme.value.color.warning.l2,
7171
activeBgColor: theme.value.color.warning.l4,
7272
invertedColor: theme.value.color.warning.n,
@@ -77,7 +77,7 @@ const styleVars = computed(() => {
7777
case "common":
7878
return {
7979
bgColor: theme.value.color.common.n,
80-
color: theme.value.color.foreground.min,
80+
color: theme.value.color.white,
8181
hoverBgColor: theme.value.color.common.l2,
8282
activeBgColor: theme.value.color.common.l4,
8383
invertedColor: theme.value.color.common.n,
@@ -88,7 +88,7 @@ const styleVars = computed(() => {
8888
default:
8989
return {
9090
bgColor: theme.value.color.common.n,
91-
color: theme.value.color.foreground.min,
91+
color: theme.value.color.white,
9292
hoverBgColor: theme.value.color.common.l2,
9393
activeBgColor: theme.value.color.common.l4,
9494
invertedColor: theme.value.color.common.n,

packages/hexon-web/src/themes.ts

+41-2
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export type HTheme = {
6565
post: string;
6666
page: string;
6767
draft: string;
68+
black: string;
69+
white: string;
6870
background: {
6971
transparent: string;
7072
hover: string;
@@ -107,7 +109,7 @@ export type HTheme = {
107109
};
108110
};
109111

110-
export const blueTheme: HTheme = {
112+
export const lightTheme: HTheme = {
111113
color: {
112114
primary: createColor("#3498db"),
113115
success: createColor("#27ae60"),
@@ -119,6 +121,8 @@ export const blueTheme: HTheme = {
119121
post: "#3883c7",
120122
page: "#52bad1",
121123
draft: "#f1c40f",
124+
black: "#000000",
125+
white: "#ffffff",
122126
background: {
123127
transparent: "transparent",
124128
hover: "#00000015",
@@ -140,4 +144,39 @@ export const blueTheme: HTheme = {
140144
},
141145
};
142146

143-
export default createTheme({ default: blueTheme });
147+
export const darkTheme: HTheme = {
148+
color: {
149+
primary: createColor("#3498db"),
150+
success: createColor("#27ae60"),
151+
warning: createColor("#f39c12"),
152+
error: createColor("#e74c3c"),
153+
common: createColor("#888888"),
154+
folder: "#f3c04f",
155+
all: "#27ae60",
156+
post: "#3883c7",
157+
page: "#52bad1",
158+
draft: "#f1c40f",
159+
black: "#000000",
160+
white: "#ffffff",
161+
background: {
162+
transparent: "transparent",
163+
hover: "#ffffff15",
164+
active: "#ffffff20",
165+
selected: "#ffffff10",
166+
base1: "#323232",
167+
base2: "#282828",
168+
base3: "#1f1f1f",
169+
badge: "#222222",
170+
max: "#000000",
171+
min: "#ffffff",
172+
},
173+
foreground: {
174+
main: "#dddddd",
175+
sub: "#a9a9a9",
176+
max: "#ffffff",
177+
min: "#000000",
178+
},
179+
},
180+
};
181+
182+
export default createTheme({ default: lightTheme, dark: darkTheme });

0 commit comments

Comments
 (0)