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

85 lines
3.0 KiB
Stylus
Raw Normal View History

// Deprecated function. Keep for compatibility.
2024-02-07 16:21:19 +08:00
theme($t)
convert(hexo-config('style.prefers_theme')) == $t
2022-12-10 18:43:55 +08:00
$color-background-h = hue($color-background)
$color-background-s = saturation($color-background)
$color-background-l = lightness($color-background)
2022-12-10 15:49:59 +08:00
2022-12-10 18:43:55 +08:00
$color-block-h = hue($color-block)
$color-block-s = saturation($color-block)
$color-block-l = lightness($color-block)
2022-12-09 23:56:58 +08:00
2022-12-10 18:43:55 +08:00
$color-code-h = hue($color-code)
$color-code-s = saturation($color-code)
$color-code-l = lightness($color-code)
2022-12-10 15:49:59 +08:00
2022-12-10 18:43:55 +08:00
$color-text-h = hue($color-text)
$color-text-s = saturation($color-text)
$color-text-l = lightness($color-text)
2022-12-10 15:49:59 +08:00
2024-02-07 16:21:19 +08:00
_dark_text()
2024-01-31 22:45:07 +08:00
--text: hsl($color-text-h, $color-text-s, 0)
2022-12-10 18:43:55 +08:00
--text-p1: hsl($color-text-h, $color-text-s, $color-text-l)
--text-p2: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 0.75)
--text-p3: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 1.25)
--text-p4: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 1.5)
--text-meta: hsl($color-text-h, $color-text-s, $color-text-l / 0.5 * 2)
2024-01-05 22:58:30 +08:00
--text-code: hsl($color-code-h, $color-code-s, $color-code-l)
2022-12-10 15:49:59 +08:00
2024-02-07 16:21:19 +08:00
_light_text()
2024-01-31 22:45:07 +08:00
--text: hsl($color-text-h, $color-text-s, 100)
2022-12-10 18:43:55 +08:00
--text-p1: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 0.5)
--text-p2: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 0.75)
--text-p3: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.2)
--text-p4: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.4)
--text-meta: hsl($color-text-h, $color-text-s, 100 - $color-text-l / 0.5 * 1.75)
2024-01-05 22:58:30 +08:00
--text-code: hsl($color-code-h, $color-code-s, (100 - $color-code-l) * 1.2)
2022-12-10 15:49:59 +08:00
2024-02-07 20:46:23 +08:00
_common_root()
:root
--theme-link: $color-link
2024-02-07 16:21:19 +08:00
_light_root()
--site-bg: hsl($color-background-h, $color-background-s, $color-background-l)
--card: hsl($color-block-h, $color-block-s, 100)
--block: hsl($color-block-h, $color-block-s, 95)
--block-border: hsl($color-block-h, $color-block-s, 90)
--block-hover: hsl($color-block-h, $color-block-s, 92)
--theme-link-opa: rgba($color-link, 0.2)
--leftbar-bg: hsl($color-block-h, $color-block-s, 90)
--alpha20: rgba(white, 0.2)
--alpha50: rgba(white, 0.5)
--alpha60: rgba(white, 0.6)
--alpha75: rgba(white, 0.75)
--alpha100: white
_dark_text()
2024-02-07 16:21:19 +08:00
_dark_root()
--site-bg: hsl($color-background-h, $color-background-s * 0.5, (100 - $color-background-l) * 2 + 8)
--card: hsl($color-block-h, $color-block-s * 1.2, 24)
--block: hsl($color-block-h, $color-block-s, 16)
--block-border: hsl($color-block-h, $color-block-s, 24)
--block-hover: hsl($color-block-h, $color-block-s, 20)
--theme-link-opa: rgba($color-link, 0.4)
--leftbar-bg: hsl($color-block-h, $color-block-s, 24)
--alpha20: rgba(black, 0.2)
--alpha50: rgba(black, 0.5)
--alpha60: rgba(black, 0.6)
--alpha75: rgba(black, 0.75)
--alpha100: black
_light_text()
@media screen and (max-width: $device-mobile-max)
--site-bg: black
2021-08-28 14:03:54 +08:00
2024-02-07 20:46:23 +08:00
_common_root()
:root[data-theme="light"]
2024-02-07 16:21:19 +08:00
_light_root()
:root[data-theme="dark"]
2024-02-07 16:21:19 +08:00
_dark_root()
:root:not([data-theme])
_light_root()
2021-04-02 20:24:16 +08:00
@media (prefers-color-scheme: dark)
_dark_root()