From bc210ed4263d065d3765299eaa1d06e1a4e0e98b Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Mon, 27 May 2024 08:01:45 +0300 Subject: [PATCH] main.scss: add comments --- assets/main.scss | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/assets/main.scss b/assets/main.scss index cb57fcf..819e19e 100644 --- a/assets/main.scss +++ b/assets/main.scss @@ -4,24 +4,20 @@ @import "{{ site.theme }}"; +// Declares support for light and dark themes as high as possible :root { color-scheme: light dark !important; } +// Reverts all colors to browser default so light/dark modes are supported +// without extra work and we get free accessibility * { color: revert !important; text-color: revert !important; background-color: revert !important; } -@media (prefers-color-scheme: dark) { - .site-nav { - color-scheme: only dark !important; - color: #ffffff !important; - background-color: #1c1b22 !important; - } -} - +// Fix transparent mobile navbar @media (prefers-color-scheme: light) { .site-nav { color-scheme: only light !important; @@ -29,3 +25,10 @@ background-color: #ffffff !important; } } +@media (prefers-color-scheme: dark) { + .site-nav { + color-scheme: only dark !important; + color: #ffffff !important; + background-color: #1c1b22 !important; + } +}