From b5be196dd98d0225b346348215cce6ad14f87a4a Mon Sep 17 00:00:00 2001 From: Alvie Rahman Date: Tue, 12 Apr 2022 17:01:14 +0100 Subject: [PATCH] move darkmode to a module --- base.css | 25 ------------------------- modules/darkmode.css | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 25 deletions(-) create mode 100644 modules/darkmode.css diff --git a/base.css b/base.css index df1d897..a31020c 100644 --- a/base.css +++ b/base.css @@ -1,12 +1,8 @@ :root { --fg-light-mode: #454545; --bg-light-mode: #fefefe; - --fg-dark-mode: #ccc; - --bg-dark-mode: #111; --a-light-mode: #07a; --a-visited-light-mode: #941352; - --a-dark-mode: #07a; - --a-visited-dark-mode: #aa346d; } body { @@ -102,24 +98,3 @@ kbd { margin-left: 0.2em; margin-right: 0.2em; } - - -@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; - } - img:hover, video:hover { - opacity: 1; - } - a { - color: var(--a-dark-mode); - } - a:visited { - color: var(--a-visited-dark-mode); - } -} diff --git a/modules/darkmode.css b/modules/darkmode.css new file mode 100644 index 0000000..8ebf136 --- /dev/null +++ b/modules/darkmode.css @@ -0,0 +1,26 @@ +:root { + --fg-dark-mode: #ccc; + --bg-dark-mode: #111; + --a-dark-mode: #07a; + --a-visited-dark-mode: #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; + } + img:hover, video:hover { + opacity: 1; + } + a { + color: var(--a-dark-mode); + } + a:visited { + color: var(--a-visited-dark-mode); + } +}