From d678b4ff1e69d7a4d367f5e6a822b0cc67e017fd Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Sat, 3 Feb 2024 16:36:29 +0800 Subject: [PATCH] [opt] border-radius --- _config.yml | 8 ++++---- source/css/_common/blockquote.styl | 2 +- source/css/_common/highlight.styl | 6 +++--- source/css/_custom.styl | 2 +- source/css/_layout/partial/article-footer.styl | 2 +- source/css/_layout/sidebar/sidebar.styl | 2 +- source/css/_layout/tag-plugins/banner.styl | 2 ++ source/css/_layout/tag-plugins/folding.styl | 2 +- source/css/_layout/tag-plugins/image.styl | 2 +- source/css/_layout/tag-plugins/link.styl | 2 +- source/css/_layout/tag-plugins/note.styl | 2 +- source/css/_layout/tag-plugins/okr.styl | 2 +- source/css/_layout/widgets/ghrepo.styl | 2 +- source/css/_plugins/aplayer.styl | 2 +- source/css/_plugins/comments/artalk.styl | 2 +- source/css/_plugins/comments/twikoo.styl | 6 +++--- source/css/_plugins/copycode.styl | 2 +- source/css/_plugins/tianli_gpt.styl | 4 ++-- 18 files changed, 27 insertions(+), 25 deletions(-) diff --git a/_config.yml b/_config.yml index 79571c8..16aa6ad 100755 --- a/_config.yml +++ b/_config.yml @@ -488,10 +488,10 @@ style: prefix: h2: https://api.iconify.design/ci:heading-h2.svg border-radius: - card: 12px - block: 12px - bar: 8px - image: 6px + card-l: 16px # 侧边栏、文章横幅位置的圆角 + card: 12px # 文章内大部分卡片的圆角 + bar: 8px # 横条类元素的圆角 + image: 12px # 图片圆角 color: # 动态颜色(会根据明暗主题重设明度值,只用关心色相和饱和度即可) background: 'hsl(212 16% 98%)' # 浅色背景颜色 diff --git a/source/css/_common/blockquote.styl b/source/css/_common/blockquote.styl index c0fea92..e8ecbc0 100644 --- a/source/css/_common/blockquote.styl +++ b/source/css/_common/blockquote.styl @@ -6,5 +6,5 @@ blockquote background: var(--block) $bd-left = 4px border-left: $bd-left solid var(--text-meta) - border-radius: $bd-left $border-bar $border-bar $bd-left + border-radius: $bd-left $border-card $border-card $bd-left color: var(--text-p2) \ No newline at end of file diff --git a/source/css/_common/highlight.styl b/source/css/_common/highlight.styl index 0e87039..34e6aec 100644 --- a/source/css/_common/highlight.styl +++ b/source/css/_common/highlight.styl @@ -12,7 +12,7 @@ p>code:not([class]),li>code:not([class]) .md-text .highlight, pre:not([class]):has(>code) margin: var(--gap-p) 0 - border-radius: $border-block + border-radius: $border-card overflow: hidden background: var(--block) line-height: 1.5 @@ -78,7 +78,7 @@ p>code:not([class]),li>code:not([class]) --fgColor-default: var(--text-p1) .gist-file border: 1px solid var(--block-border) - border-radius: $border-block + border-radius: $border-card overflow: hidden .gist-data border-bottom: 1px solid var(--block-border) @@ -102,7 +102,7 @@ table:not([class]) color: var(--text-p3) >.hljs padding: 1rem - border-radius: $border-block + border-radius: $border-card line-height: 1.5 box-sizing: border-box diff --git a/source/css/_custom.styl b/source/css/_custom.styl index 50a4853..f39d350 100644 --- a/source/css/_custom.styl +++ b/source/css/_custom.styl @@ -59,8 +59,8 @@ $fsp1 = 'calc(%s - 1px)' % $fs-body $fsp2 = 'calc(%s - 2px)' % $fs-body $fsp3 = 'calc(%s - 3px)' % $fs-body +$border-card-l = convert(hexo-config('style.border-radius.card-l')) $border-card = convert(hexo-config('style.border-radius.card')) -$border-block = convert(hexo-config('style.border-radius.block')) $border-bar = convert(hexo-config('style.border-radius.bar')) $border-image = convert(hexo-config('style.border-radius.image')) $border-button = 4px diff --git a/source/css/_layout/partial/article-footer.styl b/source/css/_layout/partial/article-footer.styl index 69fab6e..90cf0bf 100644 --- a/source/css/_layout/partial/article-footer.styl +++ b/source/css/_layout/partial/article-footer.styl @@ -2,7 +2,7 @@ margin-top: 4rem padding: 1rem background: var(--block) - border-radius: $border-block + border-radius: $border-card border: 1px solid var(--block-border) &:empty display: none diff --git a/source/css/_layout/sidebar/sidebar.styl b/source/css/_layout/sidebar/sidebar.styl index 02df52c..70477e5 100644 --- a/source/css/_layout/sidebar/sidebar.styl +++ b/source/css/_layout/sidebar/sidebar.styl @@ -1,7 +1,7 @@ .l_left margin: 8px 8px 8px 0 height: 'calc(%s - 16px)' % 100vh - border-radius: $border-card + border-radius: $border-card-l overflow: hidden .header margin: var(--gap-l) var(--gap-l) 0 diff --git a/source/css/_layout/tag-plugins/banner.styl b/source/css/_layout/tag-plugins/banner.styl index b89c162..7fc0627 100644 --- a/source/css/_layout/tag-plugins/banner.styl +++ b/source/css/_layout/tag-plugins/banner.styl @@ -1,5 +1,7 @@ .banner border-radius: $border-card + &.top + border-radius: $border-card-l position: relative overflow: hidden display: flex diff --git a/source/css/_layout/tag-plugins/folding.styl b/source/css/_layout/tag-plugins/folding.styl index 635cf3f..23c2c65 100644 --- a/source/css/_layout/tag-plugins/folding.styl +++ b/source/css/_layout/tag-plugins/folding.styl @@ -2,7 +2,7 @@ details.folding display: block padding: 1rem margin: 1rem 0 - border-radius: $border-block + border-radius: $border-card background: var(--theme-block) border: 1px solid var(--theme-border) summary diff --git a/source/css/_layout/tag-plugins/image.styl b/source/css/_layout/tag-plugins/image.styl index 06a69a6..15ed021 100644 --- a/source/css/_layout/tag-plugins/image.styl +++ b/source/css/_layout/tag-plugins/image.styl @@ -19,7 +19,7 @@ font-size: 1.125rem padding: 6px line-height: 0 - border-radius: 4px + border-radius: 40px trans3: color opacity background color: var(--text-p1) &:hover diff --git a/source/css/_layout/tag-plugins/link.styl b/source/css/_layout/tag-plugins/link.styl index 1cbb8e0..e55a65f 100644 --- a/source/css/_layout/tag-plugins/link.styl +++ b/source/css/_layout/tag-plugins/link.styl @@ -12,7 +12,7 @@ width: 300px max-width: 100% box-shadow: $boxshadow-card - border-radius: $border-bar + border-radius: $border-card hover-float() .md-text .link-card.plain diff --git a/source/css/_layout/tag-plugins/note.styl b/source/css/_layout/tag-plugins/note.styl index f5f1cf4..402d94c 100644 --- a/source/css/_layout/tag-plugins/note.styl +++ b/source/css/_layout/tag-plugins/note.styl @@ -1,7 +1,7 @@ .md-text .tag-plugin.note position: relative padding: 0.25rem 1rem - border-radius: $border-block + border-radius: $border-card background: var(--theme-block) overflow: hidden if hexo-config('tag_plugins.note.border') == true diff --git a/source/css/_layout/tag-plugins/okr.styl b/source/css/_layout/tag-plugins/okr.styl index ef1100f..0cc29c9 100644 --- a/source/css/_layout/tag-plugins/okr.styl +++ b/source/css/_layout/tag-plugins/okr.styl @@ -1,6 +1,6 @@ .md-text .tag-plugin.okr position: relative - border-radius: $border-block + border-radius: $border-card background: var(--theme-block) if hexo-config('tag_plugins.okr.border') == true border: 1px solid var(--theme-border) diff --git a/source/css/_layout/widgets/ghrepo.styl b/source/css/_layout/widgets/ghrepo.styl index 4434560..0e3e5fb 100644 --- a/source/css/_layout/widgets/ghrepo.styl +++ b/source/css/_layout/widgets/ghrepo.styl @@ -4,7 +4,7 @@ padding: 0.75rem 0.5rem color: var(--text-p2) background: var(--card) - border-radius: $border-block + border-radius: $border-card box-shadow: $boxshadow-card >div+div margin-top: 0.5rem diff --git a/source/css/_plugins/aplayer.styl b/source/css/_plugins/aplayer.styl index bf506ee..42125dd 100644 --- a/source/css/_plugins/aplayer.styl +++ b/source/css/_plugins/aplayer.styl @@ -1,3 +1,3 @@ .md-text .aplayer - border-radius: $border-block \ No newline at end of file + border-radius: $border-card \ No newline at end of file diff --git a/source/css/_plugins/comments/artalk.styl b/source/css/_plugins/comments/artalk.styl index 5ac8691..ae33c0d 100644 --- a/source/css/_plugins/comments/artalk.styl +++ b/source/css/_plugins/comments/artalk.styl @@ -1,4 +1,4 @@ .cmt-body.artalk .artalk --at-color-main: $color-theme .atk-main-editor - border-radius: $border-block \ No newline at end of file + border-radius: $border-card \ No newline at end of file diff --git a/source/css/_plugins/comments/twikoo.styl b/source/css/_plugins/comments/twikoo.styl index 42d846e..84cdea1 100644 --- a/source/css/_plugins/comments/twikoo.styl +++ b/source/css/_plugins/comments/twikoo.styl @@ -58,7 +58,7 @@ width: auto border: none padding: 6px 2rem - border-radius: $border-block + border-radius: $border-card background: var(--block) color: var(--text-p1) line-height: 2 @@ -74,7 +74,7 @@ margin-bottom: 1rem border: 1px dashed var(--block-border); padding: 1rem; - border-radius: $border-block; + border-radius: $border-card; background: var(--card); &:hover @@ -86,7 +86,7 @@ .tk-submit padding: 1rem 1rem 0 1rem; - border-radius: $border-block; + border-radius: $border-card; background: var(--card); .tk-tag diff --git a/source/css/_plugins/copycode.styl b/source/css/_plugins/copycode.styl index bb49207..2bcd5ab 100644 --- a/source/css/_plugins/copycode.styl +++ b/source/css/_plugins/copycode.styl @@ -15,7 +15,7 @@ cursor: pointer margin-right: 4px margin-top: 4px - border-radius: 'calc(%s - 4px)' % $border-block + border-radius: 'calc(%s - 4px)' % $border-card .highlight:hover .code:before diff --git a/source/css/_plugins/tianli_gpt.styl b/source/css/_plugins/tianli_gpt.styl index e31fc96..d14e64a 100644 --- a/source/css/_plugins/tianli_gpt.styl +++ b/source/css/_plugins/tianli_gpt.styl @@ -18,7 +18,7 @@ .post-TianliGPT background: var(--block) - border-radius: $border-block + border-radius: $border-card padding: 12px line-height: 1.3 border: var(--style-border-always) @@ -44,7 +44,7 @@ margin-top: 12px padding: 8px 12px background: var(--card) - border-radius: $border-block + border-radius: $border-card border: var(--style-border-always) font-size: 15px line-height: 1.4