Skip to content

Commit 9f0544d

Browse files
Merge pull request #383 from jzwood/dark-mode
adds OS controlled dark mode
2 parents a126106 + e000949 commit 9f0544d

File tree

4 files changed

+73
-18
lines changed

4 files changed

+73
-18
lines changed

dist-newstyle/cache/compiler

14 KB
Binary file not shown.

message-index/css/default.css

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
*:focus-visible {
22
outline-offset: 4px;
33
outline-width: 1px;
4-
outline-color: #DB83ED;
54
}
65

76
article .header {
@@ -12,7 +11,6 @@ article .header {
1211

1312
body {
1413
font-size: 1.6rem;
15-
color: #000;
1614
margin: 0 auto;
1715
max-width: 120rem;
1816
}
@@ -37,19 +35,15 @@ details > summary {
3735
}
3836

3937
#error-message {
40-
font-size: small;
38+
font-size: medium;
4139
}
4240

4341
.example {
4442
flex-grow: 1;
45-
overflow-x: scroll !important;
43+
overflow-x: auto;
4644
margin-top: 10px;
4745
}
4846

49-
.example pre {
50-
background-color: #FAFAFA;
51-
}
52-
5347
.example-container {
5448
min-height: 300px;
5549
display: flex;
@@ -71,7 +65,6 @@ details > summary {
7165
}
7266

7367
.filename {
74-
background-color: #EAEAEA;
7568
padding: 10px 5px 10px 5px;
7669
}
7770

@@ -85,12 +78,10 @@ footer {
8578

8679
h1 {
8780
font-size: 2.4rem;
88-
color: #6D28D9;
8981
}
9082

9183
h2 {
9284
font-size: 2rem;
93-
color: #6D28D9;
9485
}
9586

9687
header {
@@ -129,20 +120,14 @@ main {
129120
padding: 0 2%;
130121
}
131122
main code {
132-
background-color: #EDE4FA;
133123
font-family: monospace;
134124
display: inline-block;
135125
padding-left: 2px;
136126
padding-right: 2px;
137127
}
138128

139-
main pre {
140-
background: #fafafa;
141-
}
142-
143129
main pre code {
144130
padding: 10px;
145-
background: #fafafa;
146131
}
147132

148133
nav.breadcrumb {
@@ -152,7 +137,6 @@ nav.breadcrumb {
152137

153138
nav.breadcrumb a {
154139
font-weight: normal;
155-
color: black;
156140
text-decoration: underline;
157141
text-transform: none;
158142
display: inline;

message-index/css/theme.css

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
:root {
2+
--bg-color: #FFFFFF;
3+
--text-color: #333;
4+
--outline-color: #DB83ED;
5+
--header-color: #5E5184;
6+
--anchor-color: #9E358F;
7+
--anchor-visited-color: #6F5F9C;
8+
--code-bg-color: #FAFAFA;
9+
--filename-bg: #EAEAEA;
10+
}
11+
12+
@media (prefers-color-scheme: dark) {
13+
:root {
14+
--bg-color: #333;
15+
--text-color: #C9D1D9;
16+
--header-color: #BBA1FF;
17+
--anchor-color: #EB82DC;
18+
--anchor-visited-color: #D5C5FF;
19+
--code-bg-color: transparent;
20+
--filename-bg: #2C2C2C;
21+
}
22+
23+
/* TODO: this is a stopgap until there's custom highlighting for dark mode */
24+
code.hljs {
25+
background-color: transparent;
26+
filter: invert(1);
27+
}
28+
}
29+
30+
*:focus-visible {
31+
outline-color: var(--outline-color);
32+
}
33+
34+
body {
35+
color: var(--text-color);
36+
background-color: var(--bg-color);
37+
}
38+
39+
a {
40+
color: var(--anchor-color);
41+
}
42+
43+
a:visited {
44+
color: var(--anchor-visited-color);
45+
}
46+
47+
h1, h2, h3, h4, h5, h6 {
48+
color: var(--header-color);
49+
}
50+
51+
input {
52+
background-color: rgba(255, 255, 255, 0.06);
53+
color: var(--text-color);
54+
}
55+
56+
details {
57+
border: 2px solid #C7A1FF;
58+
}
59+
60+
main code, main pre, main pre code, .example pre {
61+
background-color: var(--code-bg-color);
62+
}
63+
64+
.filename {
65+
background-color: var(--filename-bg);
66+
}
67+
68+
nav.breadcrumb a {
69+
color: var(--text-color);
70+
}

message-index/templates/default.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<link rel="stylesheet" href="/css/highlight.css">
1111
<script src="/js/highlight.min.js"></script>
1212
<link rel="stylesheet" href="/css/default.css" />
13+
<link rel="stylesheet" href="/css/theme.css" />
1314
</head>
1415

1516
<body>

0 commit comments

Comments
 (0)