summaryrefslogtreecommitdiff
path: root/src/components/Root.scss
diff options
context:
space:
mode:
authorHaishan <[email protected]>2022-03-06 17:23:14 +0800
committerGitHub <[email protected]>2022-03-06 17:23:14 +0800
commit8b2e4b6609deea56fdcafdf88172e577e5fadc38 (patch)
tree9eae0c4359bbdced9afef25f67de799dcb50ac92 /src/components/Root.scss
parent3e87d8b52e62c6f8da48176c81267bacd36e3965 (diff)
parentd87cc00fc83bb2bc5c1ffa69b4dad71d51e1cc66 (diff)
Merge pull request #675 from haishanh/automatic-color-scheme
Diffstat (limited to 'src/components/Root.scss')
-rw-r--r--src/components/Root.scss14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/components/Root.scss b/src/components/Root.scss
index 0df5819..4ae7d5f 100644
--- a/src/components/Root.scss
+++ b/src/components/Root.scss
@@ -124,10 +124,16 @@ body {
--select-bg-hover: url(data:image/svg+xml,%0A%20%20%20%20%3Csvg%20width%3D%228%22%20height%3D%2224%22%20viewBox%3D%220%200%208%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%207L7%2011H1L4%207Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%20%20%3Cpath%20d%3D%22M4%2017L1%2013L7%2013L4%2017Z%22%20fill%3D%22%23222222%22%20%2F%3E%0A%20%20%20%20%3C%2Fsvg%3E%0A%20%20);
}
-// we don't have a "system" or "auto" mode now
-// it's just not make sense to have these yet
-// @media (prefers-color-scheme: dark) {}
-// @media (prefers-color-scheme: light) {}
+:root[data-theme='auto'] {
+ @media (prefers-color-scheme: dark) {
+ @include dark;
+ color-scheme: dark;
+ }
+ @media (prefers-color-scheme: light) {
+ @include light;
+ color-scheme: light;
+ }
+}
:root[data-theme='dark'] {
@include dark;