hexo-theme-stellar/source/css/_defines/theme.styl

56 lines
1.9 KiB
Stylus

$dynamic-block-h = hue($dynamic-block)
$dynamic-block-s = saturation($dynamic-block)
$dynamic-block-l = lightness($dynamic-block)
set_text_light()
--text-p0: $dark-title
--text-p1: mix($dark-text, $dark-background, 85)
--text-p2: mix($dark-text, $dark-background, 70)
--text-p3: mix($dark-text, $dark-background, 45)
--text-p4: mix($dark-text, $dark-background, 35)
--text-meta: mix($dark-text, $dark-background, 30)
--text-code: $dark-code
set_text_dark()
--text-p0: $light-title
--text-p1: $light-text
--text-p2: mix($light-text, $light-background, 80)
--text-p3: mix($light-text, $light-background, 60)
--text-p4: mix($light-text, $light-background, 35)
--text-meta: mix($light-text, $light-background, 20)
--text-code: $light-code
:root
--site-bg: $light-background
--card: $light-card
--block: hsl($dynamic-block-h, $dynamic-block-s, 95)
--block-border: hsl($dynamic-block-h, $dynamic-block-s, 90)
--block-hover: hsl($dynamic-block-h, $dynamic-block-s, 92)
--block-lighten: hsl($dynamic-block-h, $dynamic-block-s, 100)
set_text_dark()
--theme-highlight: darken($color-theme, 5)
--theme-bg: mix($color-theme, $light-card, 10)
--theme-link: $color-link
set_darkmode()
:root
--site-bg: $dark-background
--card: $dark-card
--block: hsl($dynamic-block-h, $dynamic-block-s, 12)
--block-border: hsl($dynamic-block-h, $dynamic-block-s, 24)
--block-hover: hsl($dynamic-block-h, $dynamic-block-s, 9)
--block-lighten: hsl($dynamic-block-h, $dynamic-block-s, 30)
set_text_light()
--theme-highlight: $color-theme
--theme-bg: mix($color-theme, $dark-card, 10)
@media screen and (max-width: $device-mobile-max)
--site-bg: $dark-background-mobile
--card: darken($dark-card, 6)
if hexo-config('style.darkmode') == 'auto'
// dark
@media (prefers-color-scheme: dark)
set_darkmode()
if hexo-config('style.darkmode') == 'always'
set_darkmode()