Skip to content

Commit 4cf2d86

Browse files
Merge pull request #280 from mamazu/light-theme
Adding light theme based on operating system settings
2 parents a83475d + 75043af commit 4cf2d86

File tree

1 file changed

+41
-22
lines changed

1 file changed

+41
-22
lines changed

assets/web-ui/css/main.css

+41-22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,25 @@
1+
:root {
2+
--gradient-begin: #023;
3+
--gradient-end: #000;
4+
--text-color: #089;
5+
--form-element-background: #000;
6+
--table-sort-field-background: #033;
7+
--progress-bar-color: #0d0;
8+
--hover-color: #0aa;
9+
--border-color: #044;
10+
}
11+
12+
@media (prefers-color-scheme: light) {
13+
:root {
14+
--gradient-begin: white;
15+
--gradient-end: silver;
16+
--text-color: black;
17+
--form-element-background: #FFF;
18+
--table-sort-field-background: #EFF;
19+
--progress-bar-color: #151;
20+
}
21+
}
22+
123
html {
224
height: 99%;
325
}
@@ -10,15 +32,12 @@ body {
1032
}
1133

1234
* {
13-
color: #089;
35+
color: var(--text-color);
1436
}
1537

1638
body, #colorscheme-panel {
1739
background: #023;
18-
background: -webkit-linear-gradient(#023, #000);
19-
background: -o-linear-gradient(#023, #000);
20-
background: -moz-linear-gradient(#023, #000);
21-
background: linear-gradient(#023, #000);
40+
background: linear-gradient(var(--gradient-begin), var(--gradient-end));
2241
background-repeat: no-repeat;
2342
background-attachment: fixed;
2443
}
@@ -36,20 +55,20 @@ form#config em {
3655
display: inline-block;
3756
vertical-align: top;
3857
width: 300px;
39-
margin-left: 10px;
40-
margin-bottom: 20px;
58+
margin-left: 10px;
59+
margin-bottom: 20px;
4160
}
4261

4362
form#config input,
4463
form#config textarea {
4564
vertical-align: top;
46-
border: 1px solid #044;
47-
background-color: #000;
65+
border: 1px solid var(--border-color);
66+
background-color: var(--form-element-background);
4867
}
4968

5069
form#config select {
5170
margin-bottom: 10px;
52-
background-color: #000;
71+
background-color: var(--form-element-background);
5372
width: 280px;
5473
}
5574

@@ -66,18 +85,18 @@ table.data_table tr {
6685

6786
table.data_table th,
6887
table.data_table td {
69-
border: 1px solid #044;
88+
border: 1px solid var(--border-color);
7089
margin: 0;
7190
padding: 3px;
7291
}
7392

7493
table.data_table th.data_table-sort,
7594
table.data_table th:hover {
76-
background-color: #023;
95+
background-color: var(--table-sort-field-background);
7796
}
7897

7998
table.data_table tbody > tr:hover {
80-
background-color: #033;
99+
background-color: var(--table-sort-field-background);
81100
}
82101

83102
table.data_table td.breakable-text {
@@ -98,8 +117,8 @@ table.data_table td > a {
98117
position: relative;
99118
left: -50%;
100119
top: 200px;
101-
border: solid 1px #0aa;
102-
background-color: #023;
120+
border: solid 1px var(--border-color);
121+
background-color: var(--gradient-end);
103122
width: 400px;
104123
height: 200px;
105124
padding: 10px;
@@ -111,13 +130,13 @@ table.data_table td > a {
111130
display: none;
112131
width: 100%;
113132
height: 20px;
114-
border: solid 1px #099;
133+
border: solid 1px var(--border-color);
115134
padding: 1px;
116135
}
117136

118137
#init-report div.progress > div {
119138
height: 100%;
120-
background-color: #0d0;
139+
background-color: var(--progress-bar-color);
121140
}
122141

123142
#overview,
@@ -137,7 +156,7 @@ table.data_table td > a {
137156
}
138157

139158
.widget:hover {
140-
border: solid 1px #0aa;
159+
border: solid 1px var(--hover-color);
141160
}
142161

143162
.visualization {
@@ -150,7 +169,7 @@ table.data_table td > a {
150169
}
151170

152171
#metric-selector select {
153-
background-color: #000;
172+
background-color: var(--form-element-background);
154173
}
155174

156175
#colorscheme-panel {
@@ -174,7 +193,7 @@ table.data_table td > a {
174193
#colorscheme-panel button, #colorscheme-panel input, #colorscheme-panel textarea, #search-container input {
175194
font-family: monospace;
176195
font-size: 12px;
177-
background-color: #000;
196+
background-color: var(--form-element-background);
178197
border: 1px solid #0898;
179198
}
180199

@@ -235,7 +254,7 @@ table.data_table td > a {
235254

236255
#flatprofile table th,
237256
#flatprofile table td {
238-
border: 1px solid #044;
257+
border: 1px solid var(--border-color);
239258
margin: 0;
240259
padding-left: 2px;
241260
padding-right: 2px;
@@ -247,7 +266,7 @@ table.data_table td > a {
247266

248267
#flatprofile table th.sort,
249268
#flatprofile table th.sortable:hover {
250-
background-color: #023;
269+
background-color: var(--table-sort-field-background);
251270
}
252271

253272
#flatprofile table td {

0 commit comments

Comments
 (0)