From e1f617f582d9f4310e0bbb8ca995712d5030e345 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 10 Dec 2022 15:49:59 +0800 Subject: [PATCH] [opt] color --- _config.yml | 18 +---- scripts/tags/border.js | 10 ++- scripts/tags/note.js | 10 ++- source/css/_common/blockquote.styl | 2 +- source/css/_custom.styl | 24 ++----- source/css/_defines/theme.styl | 60 ++++++++++------- source/css/_layout/md.styl | 6 +- source/css/_layout/partial/paginator.styl | 3 +- source/css/_layout/tag-plugins/common.styl | 77 +++++++--------------- source/css/_layout/widgets/toc_common.styl | 2 +- source/css/_plugins/comments/twikoo.styl | 1 - 11 files changed, 81 insertions(+), 132 deletions(-) diff --git a/_config.yml b/_config.yml index 1d31f81..a3f86e0 100755 --- a/_config.yml +++ b/_config.yml @@ -346,23 +346,11 @@ style: button: 'hsl(192 98% 55%)' # 按钮颜色 hover: 'hsl(14 100% 57%)' # 按钮高亮颜色 # 动态颜色(会根据明暗主题重设明度值,只用关心色相和饱和度即可) - dynamic: + dynamic: + background: 'hsl(212 16% 98%)' # 浅色背景颜色 block: 'hsl(212 8% 95%)' # 块背景颜色 - light: - background: hsl(212 16% 98%) # 浅色背景颜色 - block: 'hsl(212 8% 95%)' # 块背景颜色 - card: 'white' # 卡片背景颜色 - title: 'black' # 标题文本颜色 - text: 'hsl(0 0% 20%)' # 正文文本颜色 code: 'hsl(14 100% 48%)' # 行内代码颜色 - dark: - background: 'hsl(212 6% 16%)' # 深色背景颜色 - background-mobile: black # 移动端深色背景(OLED调成纯黑可以省电) - block: 'hsl(212 8% 20%)' # 块背景颜色 - card: 'hsl(212 10% 22%)' # 卡片背景颜色 - title: 'white' # 标题文本颜色 - text: 'hsl(0 0% 93%)' # 正文文本颜色 - code: 'hsl(14 100% 63%)' # 行内代码颜色 + text: 'hsl(0 0% 20%)' # 文本颜色 animated_avatar: animate: auto # auto, always background: https://fastly.jsdelivr.net/gh/cdn-x/placeholder@1.0.2/avatar/round/rainbow64@3x.webp diff --git a/scripts/tags/border.js b/scripts/tags/border.js index 2705bb9..4e6d44e 100644 --- a/scripts/tags/border.js +++ b/scripts/tags/border.js @@ -11,13 +11,11 @@ hexo.extend.tag.register('border', function(args, content) { args = hexo.args.map(args, ['color', 'child'], ['title']); - const color = args.color; - const title = args.title; - var el = ''; - const defaultColor = hexo.theme.config.tag_plugins.note.default_color; - if (!color && defaultColor) { - color = defaultColor; + const { title } = args; + if (args.color == null) { + args.color = hexo.theme.config.tag_plugins.note.default_color } + var el = ''; // header el += '