Dark mode through media query.

Browsers can prefer a certain color scheme. This commit implements a new
dark color scheme for the website which is supposed to be a placeholder,
better colors could be chosen.
supakeen 2 years ago
parent 22023e63ee
commit 38925e7381

@ -1,12 +1,26 @@
/*$background: #f9f9f9ff;*/ :root {
--color-background: #f9f9f9;
--color-text: #000000;
--color-text-subdued: #4f4e4e;
--color-text-attention: teal;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: #111111;
--color-text: #f9f9f9;
--color-text-subdued: #cccccc;
--color-text-attention: teal;
}
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
html, body { html, body {
/* background-color: rgb(248, 249, 236); */ color: var(--color-text);
background-color: #f9f9f9ff; background: var(--color-background);
font-family: sans-serif; font-family: sans-serif;
padding: 0; padding: 0;
min-height: 100%; min-height: 100%;
@ -47,7 +61,7 @@ header .logoContainer .siteTag {
right: 0; right: 0;
bottom: 0; bottom: 0;
color: teal; color: var(--color-text-attention);
font-size: 1.3em; font-size: 1.3em;
} }
@ -73,7 +87,10 @@ footer {
grid-area: footer; grid-area: footer;
border-top: 1px solid black; border-top: 1px solid black;
height: 2em; height: 2em;
background-color: #f9f9f9ff; }
main a, footer a {
color: var(--color-text-attention);
} }
.counter { .counter {
@ -84,8 +101,8 @@ footer {
} }
.staticContent { .staticContent {
margin: 0 2em; margin: 0 2em;
max-width: 900px; max-width: 900px;
} }
.linkSpacer { .linkSpacer {

@ -1,14 +1,26 @@
$pagePadding: 0.5em; :root {
/*$background: #f9f9f9ff;*/ --color-background: #f9f9f9;
$background: #f9f9f9ff; --color-text: #000000;
--color-text-subdued: #4f4e4e;
--color-text-attention: teal;
}
@media (prefers-color-scheme: dark) {
:root {
--color-background: #111111;
--color-text: #f9f9f9;
--color-text-subdued: #cccccc;
--color-text-attention: teal;
}
}
* { * {
box-sizing: border-box; box-sizing: border-box;
} }
html, body { html, body {
/* background-color: rgb(248, 249, 236); */ color: var(--color-text);
background-color: $background; background: var(--color-background);
font-family: sans-serif; font-family: sans-serif;
padding: 0; padding: 0;
min-height: 100%; min-height: 100%;
@ -47,7 +59,7 @@ header {
right: 0; right: 0;
bottom: 0; bottom: 0;
color: teal; color: var(--color-text-attention);
font-size: 1.3em; font-size: 1.3em;
} }
@ -68,7 +80,6 @@ main {
grid-area: content; grid-area: content;
margin-bottom: 2em; margin-bottom: 2em;
div.search { div.search {
input { width: 100%; } input { width: 100%; }
} }
@ -78,7 +89,10 @@ footer {
grid-area: footer; grid-area: footer;
border-top: 1px solid black; border-top: 1px solid black;
height: 2em; height: 2em;
background-color: $background; }
main a, footer a {
color: var(--color-text-attention);
} }
.counter { .counter {
@ -89,8 +103,8 @@ footer {
} }
.staticContent { .staticContent {
margin: 0 2em; margin: 0 2em;
max-width: 900px; max-width: 900px;
} }
.linkSpacer { .linkSpacer {

Loading…
Cancel
Save