Skip to content

Commit 4666599

Browse files
committed
feat: light mode for the freaks
and made theme (mainly) match https://portal2.sr
1 parent ec9ff1b commit 4666599

3 files changed

Lines changed: 48 additions & 16 deletions

File tree

content/index/03_general-rules/00_inputs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Input Methods
22

3-
<span style="color:#ff8888;font-weight:bold;">
3+
<span style="color:var(--red);font-weight:bold;">
44
IF YOU ARE UNSURE WHETHER A COMMAND OR INPUT METHOD IS ALLOWED, CHECK WITH A MODERATOR FOR YOUR
55
CATEGORY BEFORE USING IT.
66
</span>

content/scroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
}
4545
const start = min * 100;
4646
const end = max * 100;
47-
nav.style.background = `linear-gradient(180deg, #ffffff10 ${start}%, #0000 ${end}%)`;
47+
nav.style.background = `linear-gradient(180deg, var(--nav-shadow) ${start}%, #0000 ${end}%)`;
4848
};
4949

5050
const addAnchors = () => {

content/style.css

Lines changed: 46 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,31 @@
22

33
/* This makes some browser-specific elements look neater, such as dark scrollbars */
44
:root {
5-
color-scheme: dark;
5+
--foreground: black;
6+
--background: white;
7+
--background-secondary: #c0c0c0;
8+
--background-tertiary: #a7a7a7;
9+
--border: #aaa;
10+
--link: #29f;
11+
--red: #f44;
12+
--darker: #888;
13+
--nav-shadow: #00000010;
14+
@media (prefers-color-scheme: dark) {
15+
--foreground: white;
16+
--background: #0F0F0F;
17+
--background-secondary: #151515;
18+
--background-tertiary: #212121;
19+
--border: #555;
20+
--link: #4cd;
21+
--red: #f88;
22+
--darker: black;
23+
--nav-shadow: #ffffff10;
24+
color-scheme: dark;
25+
26+
nav img {
27+
filter: none;
28+
}
29+
}
630
}
731

832
body {
@@ -12,8 +36,8 @@ body {
1236

1337
margin: 0;
1438

15-
color: #f8f8f8;
16-
background: #212121;
39+
color: var(--foreground);
40+
background: var(--background);
1741

1842
font-family: 'Barlow Semi Condensed', sans-serif;
1943
font-size: 1.1em;
@@ -28,7 +52,7 @@ nav {
2852
box-sizing: border-box;
2953

3054
padding: 15px 30px;
31-
background: #212121;
55+
background: var(--background);
3256

3357
/* Don't let the user scroll when only the menu icon is shown */
3458
overflow: hidden;
@@ -38,7 +62,7 @@ nav {
3862

3963
/* Animate menu opening and closing on mobile */
4064
z-index: 1;
41-
transition: .3s ease;
65+
transition: height .3s ease;
4266

4367
overscroll-behavior: none;
4468
}
@@ -71,6 +95,7 @@ nav {
7195
nav img {
7296
float: left;
7397
padding-right: 1em;
98+
filter: invert(100%);
7499
}
75100

76101
nav h2 {
@@ -99,10 +124,13 @@ main > div {
99124
}
100125

101126
a {
102-
color: #4cd;
127+
color: var(--link);
103128
text-decoration: none;
104129
margin-bottom: 0.15em;
105130
}
131+
main a {
132+
font-weight: 600;
133+
}
106134

107135
nav .navindent {
108136
display: flex;
@@ -115,9 +143,9 @@ nav .navindent {
115143
code, time {
116144
padding: 1px 2px;
117145

118-
background: #3a3a3a;
146+
background: var(--background-secondary);
119147

120-
border: 1px solid #555;
148+
border: 1px solid var(--border);
121149
border-radius: 5px;
122150
}
123151

@@ -139,10 +167,13 @@ tr.hidden {
139167
}
140168

141169
:nth-child(odd of tr:not(.hidden)) {
142-
background: #383838;
170+
background: var(--background-secondary);
143171
}
144172
:nth-child(even of tr:not(.hidden)) {
145-
background: #2a2a2a;
173+
background: var(--background-tertiary);
174+
}
175+
.red {
176+
color: var(--red);
146177
}
147178

148179
h1 {
@@ -206,8 +237,9 @@ p, li {
206237
width: 25rem;
207238
padding: 1em;
208239

209-
background: #141414;
210-
border-radius: 3px;
240+
background: var(--background-tertiary);
241+
border-radius: 1%;
242+
filter: drop-shadow(0px 0px 5px var(--darker));
211243
}
212244

213245
.category h5 {
@@ -221,7 +253,7 @@ p, li {
221253
}
222254

223255
.category hr {
224-
color: white;
256+
color: var(--border);
225257
width: 100%;
226258
margin: 1em 0 1em 0;
227259
}
@@ -230,9 +262,9 @@ table.commands tbody {
230262
display: block;
231263

232264
max-width: calc(100vw - 2 * 20px); /* 20px is the horizontal padding on "main" */
233-
min-height: 30em;
234265
max-height: 30em;
235266
overflow: auto;
267+
border: 2px solid var(--border);
236268
}
237269

238270
table.commands tr:nth-child(1) {

0 commit comments

Comments
 (0)