Skip to content

Commit aafbf50

Browse files
committed
Add dark theme
1 parent 9524fbc commit aafbf50

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

_layouts/default.html

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,33 @@
88
<link rel="index" title="Erik Rigtorp" href="/">
99
<title>{{ page.title }}</title>
1010
<style type="text/css">
11+
:root {
12+
--background-color: #fff;
13+
--text-color: #1f1f1f;
14+
--link-color: #0b57d0;
15+
--link-color-hover: #041e49;
16+
}
17+
@media (prefers-color-scheme: dark) {
18+
:root {
19+
--background-color: #1f1f1f;
20+
--text-color: #e3e3e3;
21+
--link-color: #a8c7fa;
22+
--link-color-hover: #d3e3fd;
23+
}
24+
}
1125
body {
12-
margin:40px auto;
13-
max-width: 650px;
14-
line-height:1.6;
15-
font-size:18px;
16-
color:#444;
26+
margin: 40px auto;
27+
max-width: 70ch;
28+
line-height: 1.5;
29+
background: var(--background-color);
30+
color: var(--text-color);
1731
padding:0 10px;
1832
font-family: "Georgia", "Times New Roman", Times, serif;
33+
font-size: 1em;
1934
}
20-
h1,h2,h3 { line-height:1.2; }
35+
h1,h2,h3 { line-height: 1.2; }
36+
a { color: var(--link-color); }
37+
a:hover { color: var(--link-color-hover); }
2138
</style>
2239
</head>
2340
<body>

0 commit comments

Comments
 (0)