fix darkmode

This commit is contained in:
xaoxuu 2022-10-22 13:59:21 +08:00
parent 7a742d61fe
commit 885c0f4dce
6 changed files with 64 additions and 42 deletions

View File

@ -5,6 +5,9 @@ if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
:root
--blur-bg: alpha(black, .5)
if hexo-config('style.darkmode') == 'always'
:root
--blur-bg: alpha(black, .5)
.blur
background: var(--blur-bg)

View File

@ -24,6 +24,8 @@
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
--blur-bg: alpha(#555, .6)
if hexo-config('style.darkmode') == 'always'
--blur-bg: alpha(#555, .6)
.sidebar-toggle.mobile
cursor: pointer

View File

@ -26,6 +26,8 @@
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
box-shadow: none
if hexo-config('style.darkmode') == 'always'
box-shadow: none
.proj-wrap
display: grid

View File

@ -47,43 +47,48 @@
--theme-bg: #444
color: var(--card) !important
set_darkmode_tags()
.tag-plugin[color='red']
--theme-border: mix($c-red, $dark-card, 80)
--theme-bg: mix($c-red, $dark-card, 10)
.tag-plugin[color='orange']
--theme-border: mix($c-orange, $dark-card, 80)
--theme-bg: mix($c-orange, $dark-card, 10)
.tag-plugin[color='yellow']
--theme-border: mix($c-yellow, $dark-card, 80)
--theme-bg: mix($c-yellow, $dark-card, 10)
.tag-plugin[color='green']
--theme-border: mix($c-green, $dark-card, 80)
--theme-bg: mix($c-green, $dark-card, 10)
.tag-plugin[color='cyan']
--theme-border: mix($c-cyan, $dark-card, 80)
--theme-bg: mix($c-cyan, $dark-card, 10)
.tag-plugin[color='blue']
--theme-border: mix($c-blue, $dark-card, 80)
--theme-bg: mix($c-blue, $dark-card, 10)
.tag-plugin[color='purple']
--theme-border: mix($c-purple, $dark-card, 80)
--theme-bg: mix($c-purple, $dark-card, 10)
.tag-plugin[color='light']
--theme-border: white
--theme-bg: #ddd
color: var(--card) !important
.tag-plugin[color='dark']
--theme-border: black
--theme-bg: #222
color: var(--text-p1) !important
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
.tag-plugin[color='red']
--theme-border: mix($c-red, $dark-card, 80)
--theme-bg: mix($c-red, $dark-card, 10)
set_darkmode_tags()
.tag-plugin[color='orange']
--theme-border: mix($c-orange, $dark-card, 80)
--theme-bg: mix($c-orange, $dark-card, 10)
.tag-plugin[color='yellow']
--theme-border: mix($c-yellow, $dark-card, 80)
--theme-bg: mix($c-yellow, $dark-card, 10)
.tag-plugin[color='green']
--theme-border: mix($c-green, $dark-card, 80)
--theme-bg: mix($c-green, $dark-card, 10)
.tag-plugin[color='cyan']
--theme-border: mix($c-cyan, $dark-card, 80)
--theme-bg: mix($c-cyan, $dark-card, 10)
.tag-plugin[color='blue']
--theme-border: mix($c-blue, $dark-card, 80)
--theme-bg: mix($c-blue, $dark-card, 10)
.tag-plugin[color='purple']
--theme-border: mix($c-purple, $dark-card, 80)
--theme-bg: mix($c-purple, $dark-card, 10)
.tag-plugin[color='light']
--theme-border: white
--theme-bg: #ddd
color: var(--card) !important
.tag-plugin[color='dark']
--theme-border: black
--theme-bg: #222
color: var(--text-p1) !important
if hexo-config('style.darkmode') == 'always'
set_darkmode_tags()

View File

@ -106,10 +106,16 @@
.tk-comments-no
color: var(--text-p1);
set_darkmode_comments()
.cmt-body.twikoo
--twikoo-lighttext: #f2b94b;
--twikoo-secondtext: #a1a2b8;
--twikoo-emoji-background: darken($dark-block, 1);
--twikoo-theme: #409eff;
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
.cmt-body.twikoo
--twikoo-lighttext: #f2b94b;
--twikoo-secondtext: #a1a2b8;
--twikoo-emoji-background: darken($dark-block, 1);
--twikoo-theme: #409eff;
set_darkmode_comments()
if hexo-config('style.darkmode') == 'always'
set_darkmode_comments()

View File

@ -49,12 +49,16 @@
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
box-shadow: none
if hexo-config('style.darkmode') == 'always'
box-shadow: none
&:active
background: linear-gradient(145deg, #eee, #fff)
box-shadow: 0px 0px 0px rgba(0, 0, 0, 0.1), -0px -0px 0px rgba(255, 255, 255, 0.8), inset 2px 2px 4px rgba(0, 0, 0, 0.1), inset -2px -2px 4px rgba(255, 255, 255, 1), inset -8px -8px 16px rgba(255, 255, 255, 0.4)
if hexo-config('style.darkmode') == 'auto'
@media (prefers-color-scheme: dark)
box-shadow: none
if hexo-config('style.darkmode') == 'always'
box-shadow: none
.vedit
.vctrl span
padding: 0