simplify dark mode implementation

This commit is contained in:
Akbar Rahman 2022-04-12 17:22:02 +01:00
parent 1237d953b5
commit af0a758eb9
Signed by: alvierahman90
GPG Key ID: 20609519444A1269
2 changed files with 12 additions and 22 deletions

View File

@ -1,24 +1,24 @@
:root {
--fg-light-mode: #454545;
--bg-light-mode: #fefefe;
--a-light-mode: #07a;
--a-visited-light-mode: #941352;
--fg: #454545;
--bg: #fefefe;
--a: #07a;
--a-visited: #941352;
}
body {
font-family: monospace, sans-serif;
color: var(--fg-light-mode);
color: var(--fg);
font-size: 16px;
margin: 2em auto;
max-width: 800px;
padding: 1em;
line-height: 1.4;
overflow-wrap: break-word;
background-color: var(--bg-light-mode);
background-color: var(--bg);
}
a { color: var(--a-light-mode); }
a:visited { color: var(--a-visited-light-mode); }
a { color: var(--a); }
a:visited { color: var(--a-visited); }
.tableWrapper {
max-width: 100%;

View File

@ -1,15 +1,11 @@
:root {
--fg-dark-mode: #ccc;
--bg-dark-mode: #111;
--a-dark-mode: #07a;
--a-visited-dark-mode: #aa346d;
--fg: #ccc;
--bg: #111;
--a: #07a;
--a-visited: #aa346d;
}
@media (prefers-color-scheme: dark) {
body {
color: var(--fg-dark-mode);
background-color: var(--bg-dark-mode);
}
img, video {
opacity: .75;
transition: opacity .5s ease-in-out;
@ -17,10 +13,4 @@
img:hover, video:hover {
opacity: 1;
}
a {
color: var(--a-dark-mode);
}
a:visited {
color: var(--a-visited-dark-mode);
}
}