site.lyte.dev/src/stylus/theme.styl

104 lines
2.1 KiB
Stylus
Raw Normal View History

2020-12-16 00:13:13 -06:00
light-syntax = {
brd: rgba(255, 255, 255, 0.2),
bg: rgba(0, 0, 0, 0.05),
ledg: #ccc,
sh: #775,
name: #480,
mag: #d04,
lit: #40f,
lits: #660,
aq: #04d,
err: #960050,
}
dark-syntax = {
brd: rgba(255, 255, 255, 0.2),
bg: rgba(255, 255, 255, 0.03),
ledg: #333,
sh: #75715e,
name: #a6e22e,
mag: #f92672,
lit: #ae81ff,
lits: #e6db74,
aq: #66d9ef,
err: #960050,
}
theme-colors = {
heading-fg: #333,
icon-shadow: #fff,
link-visited-fg: #666,
link-fg: #000,
2020-12-16 00:13:13 -06:00
}
:root
2020-12-17 16:37:54 -06:00
--syntax-bpx: 5px
--ff system-ui, sans-serif
2022-02-28 22:47:38 -06:00
--msff ldiosevka, IosevkaLyteWeb, IosevkaLyte, Iosevka, "Fira Code", monospace
2020-12-16 00:13:13 -06:00
--pc #df3c59
--pcd #8e293b
light-theme =
for k, v in light-syntax
--syntax-{k}: v
for k2, v2 in theme-colors
{unquote("--" + k2)}: v2
--bg #fff
--header-bg #eee
2020-12-18 10:01:32 -06:00
--header-hover-bg #ddd
2020-12-16 00:13:13 -06:00
--fg #111
2020-12-18 09:52:02 -06:00
--inline-code-bg #ddd
2020-12-18 10:01:32 -06:00
--input-bg rgba(0, 0, 0, 0.08)
--input-hover-bg rgba(0, 0, 0, 0.16)
--input-focus-bg var(--input-bg)
--button-bg var(--input-bg)
--button-hover-bg var(--input-hover-bg)
--button-focus-bg var(--input-bg)
2020-12-16 00:13:13 -06:00
dark-theme =
for k, v in dark-syntax
--syntax-{k}: v
for k2, v2 in theme-colors
{unquote("--" + k2)}: invert(v2)
--bg #111
--header-bg #191919
2020-12-18 10:01:32 -06:00
--header-hover-bg #333
2020-12-16 00:13:13 -06:00
--fg #fff
--link-visited-fg #aaa
2020-12-18 09:52:02 -06:00
--inline-code-bg #222
2020-12-18 10:01:32 -06:00
--input-bg rgba(255, 255, 255, 0.08)
--input-hover-bg rgba(255, 255, 255, 0.16)
--input-focus-bg var(--input-bg)
--button-bg var(--input-bg)
--button-hover-bg var(--input-hover-bg)
--button-focus-bg var(--input-bg)
2020-12-16 00:13:13 -06:00
:root, body.light-theme
{light-theme}
body.dark-theme
{dark-theme}
:root
@media (prefers-color-scheme dark)
{dark-theme}
2020-12-17 16:37:54 -06:00
:root
@media (max-width: 600px)
--syntax-bpx 2px
2020-12-16 00:13:13 -06:00
.hide-in-light-theme
display none
@media (prefers-color-scheme dark)
.hide-in-dark-theme
display none
.hide-in-light-theme { display: inherit }
body.light-theme .hide-in-dark-theme { display: inherit }
body.dark-theme .hide-in-light-theme { display: none }
body.dark-theme .hide-in-dark-theme { display: none }
body.dark-theme .hide-in-light-theme { display: inherit }
body.light-theme .hide-in-dark-theme { display: inherit }
body.light-theme .hide-in-light-theme { display: none }