-
Notifications
You must be signed in to change notification settings - Fork 155
/
theme.ts
113 lines (108 loc) · 2.19 KB
/
theme.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import merge from "lodash.merge";
const lightModeColors = {
container: {
borderColor: "rgba(0, 0, 0, 0.3)",
},
error: {
background: "#e74c3c",
color: "#ffffff",
},
console: {
background: "rgba(0, 0, 0, 1)",
},
divider: {
background: "#202020",
dividerBackground: "#202020",
},
editor: {
backgroundColor: `#000000`,
color: `#ffffff`,
},
tabs: {
tabHeader: {
background: "transparent",
color: `#000000`,
borderBottom: `0.1em solid rgba(0, 0, 0, 0.1)`,
},
},
};
const darkModeColors = {
container: {
borderColor: "rgba(255, 255, 255, 0.4)",
},
error: {
background: "#e74c3c",
color: "#ffffff",
},
console: {
background: "rgba(0, 0, 0, 1)",
},
divider: {
background: "rgba(255, 255, 255, 0.5)",
dividerBackground: "rgba(255, 255, 255, 0.1)",
},
editor: {
backgroundColor: `#000000`,
color: `#ffffff`,
},
tabs: {
tabHeader: {
background: `rgba(1, 21, 21, 0.8)`,
panelBackground: `rgb(1, 21, 21)`,
color: `#ffffff`,
borderBottom: `0.1em solid rgba(255, 255, 255, 0.4)`,
},
selectedTab: {
borderBottom: "0.2em solid rgb(255, 255, 255)",
},
},
};
export const theme = {
container: {
borderColor: "",
minHeight: "20em",
minWidth: "15em",
},
error: {
background: "",
color: "",
},
console: {
background: "rgba(0, 0, 0, 1)",
},
divider: {
width: 4,
background: "",
dividerBackground: "",
containerWidth: 8,
},
editor: {
fontFamily: `Consolas, Menlo, Monaco, source-code-pro, Courier New, monospace`,
backgroundColor: ``,
color: ``,
},
tabs: {
tabHeader: {
borderBottom: "",
panelBackground: "",
background: "",
color: "",
},
tabPanel: {
phoneHeight: "10em",
},
selectedTab: {
background: "",
borderBottom: "0.2em solid rgb(0, 0, 0)",
},
},
};
export type ColorMode = "light" | "dark";
/**
* Get corresponding theme.
* @param mode color theme type
*/
export default function getTheme(mode: ColorMode = "light") {
const colorTheme = mode === "light" ? lightModeColors : darkModeColors;
return merge(theme, colorTheme);
}