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-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-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-06 14:07:46 +08:00
|
|
|
$fsh1 = 'calc(%s + 9px)' % $fs-body
|
2024-02-02 00:36:01 +08:00
|
|
|
$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
|
2021-12-12 16:24:33 +08:00
|
|
|
--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)
|
|
|
|
|
2024-02-06 23:39:51 +08:00
|
|
|
// 侧边栏文字内容宽度
|
|
|
|
--side-content-width: 224px
|
|
|
|
// 元素轮廓到容器边缘的间距
|
2024-02-05 18:01:50 +08:00
|
|
|
--gap-margin: 16px
|
2024-02-06 23:39:51 +08:00
|
|
|
// 元素文本内容到元素自身的轮廓的间距
|
2024-02-05 18:01:50 +08:00
|
|
|
--gap-padding: 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-12-12 16:24:33 +08:00
|
|
|
--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
|
2022-10-12 20:09:40 +08:00
|
|
|
// iPad 竖屏
|
|
|
|
@media screen and (max-width: $device-tablet)
|
2024-02-06 23:39:51 +08:00
|
|
|
--side-content-width: 188px
|
2024-02-09 00:47:03 +08:00
|
|
|
@media screen and (max-width: $device-mobile-max)
|
|
|
|
--side-content-width: 224px
|
2024-02-06 23:39:51 +08:00
|
|
|
|
|
|
|
// 动态计算值
|
|
|
|
:root
|
|
|
|
// 元素文本内容到容器边缘的间距
|
|
|
|
--gap-max: calc(var(--gap-margin) + var(--gap-padding))
|
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)
|