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

109 lines
3.7 KiB
Stylus
Raw Normal View History

2021-02-19 23:33:19 +08:00
@require('_defines/const')
//
2022-12-10 18:43:55 +08:00
$color-theme = convert(hexo-config('style.color.theme'))
$color-accent = convert(hexo-config('style.color.accent'))
$color-link = convert(hexo-config('style.color.link'))
$color-button = convert(hexo-config('style.color.button'))
$color-hover = convert(hexo-config('style.color.hover'))
2021-02-19 23:33:19 +08:00
2022-12-10 15:49:59 +08:00
//
2022-12-10 18:43:55 +08:00
$color-background = convert(hexo-config('style.color.background'))
$color-block = convert(hexo-config('style.color.block'))
$color-code = convert(hexo-config('style.color.code'))
$color-text = convert(hexo-config('style.color.text'))
2022-12-09 23:56:58 +08:00
2021-02-19 23:33:19 +08:00
// @font-face
// font-family: 'Dosis'
2022-12-20 00:09:34 +08:00
// src: url('https://gcore.jsdelivr.net/gh/volantis-x/cdn-fonts@20.5.30/Dosis/Dosis-Medium.ttf')
2021-02-19 23:33:19 +08:00
// font-weight: normal
// font-style: normal
2021-03-05 21:37:28 +08:00
$ff-body = system-ui, "Microsoft Yahei", "Segoe UI", -apple-system, Roboto, Ubuntu, "Helvetica Neue", Arial, "WenQuanYi Micro Hei", sans-serif
2022-12-15 22:09:01 +08:00
$ff-codeblock = Menlo, Monaco, Consolas, system-ui, "Courier New", monospace, sans-serif
$ff-code = $ff-codeblock
2021-02-19 23:33:19 +08:00
$ff-logo = $ff-body
2022-10-12 23:19:10 +08:00
if hexo-config('style.font-family.body')
$ff-body = convert(hexo-config('style.font-family.body'))
if hexo-config('style.font-family.code')
$ff-code = convert(hexo-config('style.font-family.code'))
2022-12-15 22:09:01 +08:00
if hexo-config('style.font-family.codeblock')
$ff-codeblock = convert(hexo-config('style.font-family.codeblock'))
2022-10-12 23:19:10 +08:00
if hexo-config('style.font-family.logo')
$ff-logo = convert(hexo-config('style.font-family.logo'))
2021-02-19 23:33:19 +08:00
// font size
2022-12-15 22:09:01 +08:00
$fs-root = convert(hexo-config('style.font-size.root'))
2021-03-05 21:37:28 +08:00
$fs-15 = .9375rem
$fs-14 = .875rem
$fs-13 = .8125rem
$fs-12 = .75rem
2024-01-18 22:11:58 +08:00
$fs-body = convert(hexo-config('style.font-size.body'))
2022-12-15 22:09:01 +08:00
$fs-code = convert(hexo-config('style.font-size.code'))
$fs-codeblock = convert(hexo-config('style.font-size.codeblock'))
2024-02-02 00:36:01 +08:00
$fsh1 = 'calc(%s + 11px)' % $fs-body
$fsh2 = 'calc(%s + 11px)' % $fs-body
$fsh3 = 'calc(%s + 7px)' % $fs-body
$fsh4 = 'calc(%s + 4px)' % $fs-body
2024-02-02 14:53:35 +08:00
$fsh5 = 'calc(%s + 2px)' % $fs-body
2024-02-02 00:36:01 +08:00
$fsp0 = 'calc(%s - 0px)' % $fs-body
$fsp1 = 'calc(%s - 1px)' % $fs-body
$fsp2 = 'calc(%s - 2px)' % $fs-body
$fsp3 = 'calc(%s - 3px)' % $fs-body
2021-02-19 23:33:19 +08:00
2024-02-03 16:36:29 +08:00
$border-card-l = convert(hexo-config('style.border-radius.card-l'))
2022-12-15 22:09:01 +08:00
$border-card = convert(hexo-config('style.border-radius.card'))
2022-12-15 22:42:48 +08:00
$border-bar = convert(hexo-config('style.border-radius.bar'))
2022-12-15 22:09:01 +08:00
$border-image = convert(hexo-config('style.border-radius.image'))
2022-12-15 22:42:48 +08:00
$border-button = 4px
2021-02-19 23:33:19 +08:00
2021-03-05 21:37:28 +08:00
//
:root
2022-10-23 18:27:14 +08:00
--width-left: 288px
--width-main: 720px
2024-02-02 00:36:01 +08:00
--fsp: $fs-body
--fsh2: 'calc(%s + 11px)' % var(--fsp)
--fsh3: 'calc(%s + 7px)' % var(--fsp)
--fsh4: 'calc(%s + 4px)' % var(--fsp)
2021-03-05 21:37:28 +08:00
--gap-l: 16px
2024-01-30 23:48:00 +08:00
--gap-p: 'calc(%s + 4px)' % $fs-body // gap for paragraph
--gap-p-compact: 'calc(%s * 0.75)' % $fs-body
2021-03-05 21:37:28 +08:00
// desktop 2k or larger
@media screen and (min-width: $device-2k)
2021-07-26 22:26:46 +08:00
--gap-l: 32px
2022-10-23 18:27:14 +08:00
--width-left: 352px
--width-main: 780px
2021-03-05 21:37:28 +08:00
// desktop 4k or larger
@media screen and (min-width: $device-4k)
--width-main: 860px
--gap-l: 64px
2022-10-12 20:09:40 +08:00
// iPad
@media screen and (max-width: $device-tablet)
2022-10-23 18:27:14 +08:00
--width-left: 252px
2022-10-12 20:09:40 +08:00
// iPad
@media screen and (max-width: $device-mobile-max)
2022-10-23 18:27:14 +08:00
--width-left: 288px
2022-10-12 20:09:40 +08:00
2024-01-18 22:11:58 +08:00
//
.l_body.story
2024-02-02 23:43:10 +08:00
--gap-p: 2rem
div.tag-plugin,p>img
2024-01-18 22:11:58 +08:00
margin-top: 2.4rem
margin-bottom: 2.4rem
2021-02-19 23:33:19 +08:00
// shadow
$boxshadow-card = 0 1px 2px 0px rgba(0, 0, 0, 0.1)
$boxshadow-float = 0 4px 8px 0px rgba(0, 0, 0, 0.1)
2024-01-03 13:28:04 +08:00
$boxshadow-card-float = 0 12px 16px -4px rgba(0, 0, 0, 0.2)
2021-07-09 21:18:14 +08:00
$boxshadow-button = 0 0 2px 0px rgba(0, 0, 0, 0.04), 0 0 8px 0px rgba(0, 0, 0, 0.04)
2024-01-05 19:43:39 +08:00
$boxshadow-block = 0 1px 4px 0px rgba(0, 0, 0, 0.02), 0 2px 8px 0px rgba(0, 0, 0, 0.02)
$boxshadow-toast = 0 4px 8px 0px rgba(0, 0, 0, 0.1), 0 12px 16px -4px rgba(0, 0, 0, 0.2)