From 191297bece58511986e2a7f9951b51a3a8e8be69 Mon Sep 17 00:00:00 2001 From: xaoxuu Date: Thu, 22 Apr 2021 23:37:14 +0800 Subject: [PATCH] update --- layout/_partial/sidebar/widgets/toc.ejs | 2 +- source/css/_custom.styl | 4 +-- source/css/_defines/func.styl | 16 +++++------- source/css/_layout/tag-plugins/common.styl | 30 ++++++++++++---------- source/css/_layout/tag-plugins/navbar.styl | 2 +- 5 files changed, 26 insertions(+), 28 deletions(-) diff --git a/layout/_partial/sidebar/widgets/toc.ejs b/layout/_partial/sidebar/widgets/toc.ejs index cb0e75b..d3be6c4 100644 --- a/layout/_partial/sidebar/widgets/toc.ejs +++ b/layout/_partial/sidebar/widgets/toc.ejs @@ -28,7 +28,7 @@ function layoutDiv(fallback) { el += ''; if (page.toc_title) { el += page.toc_title; - } else if (toc == 'wiki') { + } else if (t == 'wiki') { el += page.wiki || item.wiki; } else { el += __("meta.toc"); diff --git a/source/css/_custom.styl b/source/css/_custom.styl index 413bada..704c5ef 100644 --- a/source/css/_custom.styl +++ b/source/css/_custom.styl @@ -19,10 +19,10 @@ $light-card = white // 深色 $dark-site-bg = #20252B -$dark-block = #40454B +$dark-block = #2E353D $dark-title = #fff $dark-text = #eee -$dark-card = #2E353D +$dark-card = #40454B // 移动端深色背景(OLED调成纯黑可以省电) $dark-site-bg-mobile = black diff --git a/source/css/_defines/func.styl b/source/css/_defines/func.styl index 164baaa..e0c1068 100644 --- a/source/css/_defines/func.styl +++ b/source/css/_defines/func.styl @@ -1,10 +1,10 @@ -// 可替代 transition 使用 -transition($op = all, $time = 0.28s, $ease = ease-out) - transition: $op $time $ease - -moz-transition: $op $time $ease - -webkit-transition: $op $time $ease - -o-transition: $op $time $ease +// // 可替代 transition 使用 +// transition($op = all, $time = 0.28s, $ease = ease-out) +// transition: $op $time $ease +// -moz-transition: $op $time $ease +// -webkit-transition: $op $time $ease +// -o-transition: $op $time $ease // 为1个属性设置动画 trans1($op, $time = 0.2s) @@ -97,9 +97,5 @@ inside-box($fs = $fs-15) p,ol,ul margin-top: 0.5rem margin-bottom: 0.5rem - &:first-child - margin-top: 0 - &:last-child - margin-bottom: 0 p,li font-size: $fs diff --git a/source/css/_layout/tag-plugins/common.styl b/source/css/_layout/tag-plugins/common.styl index 18b6c23..0c0e004 100644 --- a/source/css/_layout/tag-plugins/common.styl +++ b/source/css/_layout/tag-plugins/common.styl @@ -31,49 +31,51 @@ --theme-bg: mix($c-purple, $light-card, 10) -.tag-plugin[color='white'] +.tag-plugin[color='light'] --theme-bg: white .tag-plugin[color='dark'] - --theme-bg: mix(black, $light-card, 75) + --theme-bg: #444 color: var(--card) !important if hexo-config('style.darkmode') == 'auto' @media (prefers-color-scheme: dark) .tag-plugin[color='red'] - --theme: mix($c-red, $dark-card, 40) + --theme: mix($c-red, $dark-card, 80) --theme-bg: mix($c-red, $dark-card, 10) .tag-plugin[color='orange'] - --theme: mix($c-orange, $dark-card, 40) + --theme: mix($c-orange, $dark-card, 80) --theme-bg: mix($c-orange, $dark-card, 10) .tag-plugin[color='yellow'] - --theme: mix($c-yellow, $dark-card, 40) + --theme: mix($c-yellow, $dark-card, 80) --theme-bg: mix($c-yellow, $dark-card, 10) .tag-plugin[color='green'] - --theme: mix($c-green, $dark-card, 40) + --theme: mix($c-green, $dark-card, 80) --theme-bg: mix($c-green, $dark-card, 10) .tag-plugin[color='cyan'] - --theme: mix($c-cyan, $dark-card, 40) + --theme: mix($c-cyan, $dark-card, 80) --theme-bg: mix($c-cyan, $dark-card, 10) .tag-plugin[color='blue'] - --theme: mix($c-blue, $dark-card, 40) + --theme: mix($c-blue, $dark-card, 80) --theme-bg: mix($c-blue, $dark-card, 10) .tag-plugin[color='purple'] - --theme: mix($c-purple, $dark-card, 40) + --theme: mix($c-purple, $dark-card, 80) --theme-bg: mix($c-purple, $dark-card, 10) - .tag-plugin[color='white'] - --theme-bg: white - color: var(--card) + .tag-plugin[color='light'] + --theme: white + --theme-bg: #ddd + color: var(--site-bg) !important .tag-plugin[color='dark'] - --theme-bg: mix(black, $dark-card, 75) - color: var(--text-p0) !important + --theme: black + --theme-bg: #222 + color: var(--text-p1) !important diff --git a/source/css/_layout/tag-plugins/navbar.styl b/source/css/_layout/tag-plugins/navbar.styl index a35ff66..71f766a 100644 --- a/source/css/_layout/tag-plugins/navbar.styl +++ b/source/css/_layout/tag-plugins/navbar.styl @@ -8,5 +8,5 @@ margin: 1px padding: 0.5em 0.75rem &:hover - background: #fff + background: var(--card) color: var(--text-p1)