Skip to content

Commit 92de8bf

Browse files
committed
Add dark mode to site
1 parent f4ad361 commit 92de8bf

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

site/public/styles/global.css

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--font-size-base: 16px;
33
--color-text: hsl(12, 5%, 4%);
44
--color-border: hsl(17, 24%, 90%);
5+
color-scheme: light dark;
56
}
67

78
html {
@@ -13,7 +14,7 @@ html {
1314
}
1415

1516
body {
16-
color: hsla(0, 0%, 0%, 0.8);
17+
color: light-dark(hsla(0, 0%, 0%, 0.8), white);
1718
font-family: 'Source Sans Pro', 'Helvetica Neue', 'Segoe UI', 'Helvetica', 'Arial', sans-serif;
1819
font-weight: 400;
1920
word-wrap: break-word;
@@ -44,7 +45,7 @@ h1 {
4445
text-rendering: optimizeLegibility;
4546
font-size: 2rem;
4647
line-height: 1.1;
47-
border-bottom: 1px solid rgba(0, 0, 0, 0.2);
48+
border-bottom: 1px solid light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.5));
4849
}
4950
h2 {
5051
margin-top: 1.5rem;
@@ -225,7 +226,7 @@ li > p {
225226
code {
226227
font-size: 0.85rem;
227228
line-height: 1.5rem;
228-
background: rgba(0, 0, 0, 0.05);
229+
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.2));
229230
padding: 0 0.25em;
230231
border-radius: 3px;
231232
border: 1px solid rgba(0, 0, 0, 0.1);
@@ -254,7 +255,7 @@ td:last-child {
254255
padding-right: 0;
255256
}
256257
a {
257-
color: #007a3d;
258+
color: light-dark(#007a3d, #00cd70);
258259
}
259260

260261
nav {

site/src/components/navigation/navigation-item.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const relVal = shouldPrefetch ? 'prefetch' : ''
4242

4343
a[aria-current='page'] {
4444
border-left-color: #00a453;
45-
background-color: #f2f2f2;
45+
background-color: light-dark(#f2f2f2, #2d2c2c);
4646
}
4747

4848
</style>

0 commit comments

Comments
 (0)