Skip to content

Commit 8176a5e

Browse files
committed
fix #16: initial support for dark mode
1 parent 33cb5fc commit 8176a5e

File tree

1 file changed

+30
-11
lines changed

1 file changed

+30
-11
lines changed

src/viewer/App.scss

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,29 @@
1919
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
// SOFTWARE.
22+
.root {
23+
--base-text-color: #222;
24+
--grey-text-color: #888;
25+
--ascii-view-color: #444;
26+
--main-background-color: #f8f8f8;
27+
--outgoing-frame-color: #f6ffd0;
28+
--incoming-frame-color: #ffe6ca;
29+
color-scheme: light dark;
30+
}
31+
@media(prefers-color-scheme: dark) {
32+
:root {
33+
--base-text-color: white;
34+
--grey-text-color: #d6d6d6;
35+
--ascii-view-color: #e0e0e0;
36+
--main-background-color: #404040;
37+
--outgoing-frame-color: #146500;
38+
--incoming-frame-color: #ce5500;
39+
}
40+
}
2241
.App {
2342
font-family: 'Segoe UI', Tahoma, sans-serif;
2443
font-size: 12px;
25-
color: #222;
44+
color: var(--base-text-color);
2645
overflow: hidden;
2746
}
2847
.LeftPanel {
@@ -34,7 +53,7 @@
3453
flex-shrink: 0;
3554
display: flex;
3655
flex-direction: row;
37-
background-color: #f8f8f8;
56+
background-color: var(--main-background-color);
3857
border-bottom: 1px solid #ddd;
3958
padding: 8px 8px 4px 8px;
4059
.list-filter {
@@ -52,11 +71,11 @@
5271
.list-button {
5372
flex-shrink: 0;
5473
font-size: 18px;
55-
color: #888;
74+
color: var(--grey-text-color);
5675
cursor: pointer;
5776
margin-right: 8px;
5877
&:hover {
59-
color: #222;
78+
color: var(--base-text-color);
6079
}
6180
}
6281
}
@@ -77,20 +96,20 @@
7796
margin-top: 3px;
7897
}
7998
&.frame-incoming {
80-
background-color: rgb(255, 230, 202);
99+
background-color: var(--incoming-frame-color);
81100
.fa {
82101
color: rgb(168, 104, 19);
83102
}
84103
}
85104
&.frame-outgoing {
86-
background-color: rgb(246, 255, 208);
105+
background-color: var(--outgoing-frame-color);
87106
.fa {
88107
color: rgb(98, 168, 19);
89108
}
90109
}
91110
.timestamp {
92111
margin: 0 6px 0 2px;
93-
color: #888;
112+
color: var(--grey-text-color);
94113
flex-shrink: 0;
95114
}
96115
.name {
@@ -115,7 +134,7 @@
115134
color: #ccc;
116135
}
117136
.length {
118-
color: #888;
137+
color: var(--grey-text-color);
119138
}
120139
}
121140
}
@@ -142,7 +161,7 @@
142161
padding: 4px 8px 0 8px;
143162
.tab-button {
144163
cursor: pointer;
145-
background-color: #f8f8f8;
164+
background-color: var(--main-background-color);
146165
display: inline-block;
147166
padding: 2px 12px;
148167
margin: 0 4px;
@@ -200,7 +219,7 @@
200219
display: inline-block;
201220
}
202221
.line-numbers {
203-
color: #888;
222+
color: var(--grey-text-color);
204223
margin-right: 8px;
205224
}
206225
.selected {
@@ -225,7 +244,7 @@
225244
}
226245
}
227246
.ascii-view {
228-
color: #444;
247+
color: var(--ascii-view-color);
229248
margin-left: 12px;
230249
}
231250
}

0 commit comments

Comments
 (0)