Skip to content

Commit

Permalink
🐛 修复暗色模式自动判断 #967
Browse files Browse the repository at this point in the history
  • Loading branch information
zkqiang committed Jul 2, 2023
1 parent 4d04bb6 commit 9eefc8f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/css/_pages/_base/color-schema.styl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ dark-colors()
transition background-color .2s ease-in-out

if (hexo-config("dark_mode.enable"))
@media not print and (prefers-color-scheme: dark)
@media (prefers-color-scheme: dark)
:root
--color-mode "dark"

Expand All @@ -69,3 +69,7 @@ if (hexo-config("dark_mode.enable"))
@media not print
[data-user-color-scheme="dark"]
dark-colors()

@media print
:root
--color-mode "light"

0 comments on commit 9eefc8f

Please sign in to comment.