style: optimize CSS directory structure

This commit is contained in:
XPoet 2021-01-06 11:51:39 +08:00
parent 7036ac380e
commit 217dcb8e43
9 changed files with 55 additions and 54 deletions

View File

@ -1,3 +1,5 @@
@import "../variables.styl"
$code-foreground = lighten($default-text-color, 2%) $code-foreground = lighten($default-text-color, 2%)
$code-background = darken($background-color, 5%) $code-background = darken($background-color, 5%)
$highlight-foreground = lighten($default-text-color, 2%) $highlight-foreground = lighten($default-text-color, 2%)
@ -32,37 +34,29 @@ $night-highlight-purple = #b294bb
$night-highlight-deletion = #008000 $night-highlight-deletion = #008000
$night-highlight-addition = #800000 $night-highlight-addition = #800000
code-theme(mode) {
--code-foreground: mode == 'light' ? $code-foreground : $night-code-foreground;
--code-background: mode == 'light' ? $code-background : $night-code-background;
--highlight-background: mode == 'light' ? $highlight-background : $night-highlight-background;
--highlight-foreground: mode == 'light' ? $highlight-foreground : $night-highlight-foreground;
--highlight-comment: mode == 'light' ? $highlight-comment : $night-highlight-comment;
--highlight-red: mode == 'light' ? $highlight-red : $night-highlight-red;
--highlight-orange: mode == 'light' ? $highlight-orange : $night-highlight-orange;
--highlight-yellow: mode == 'light' ? $highlight-yellow : $night-highlight-yellow;
--highlight-green: mode == 'light' ? $highlight-green : $night-highlight-green;
--highlight-aqua: mode == 'light' ? $highlight-aqua : $night-highlight-aqua;
--highlight-blue: mode == 'light' ? $highlight-blue : $night-highlight-blue;
--highlight-purple: mode == 'light' ? $highlight-purple : $night-highlight-purple;
--highlight-gutter-color: mode == 'light' ? $highlight-gutter-color : $night-highlight-gutter-color;
--highlight-gutter-bg-color: mode == 'light' ? $highlight-gutter-bg-color : $night-highlight-gutter-bg-color;
}
.normal-code-theme { .normal-code-theme {
--code-foreground: $code-foreground; code-theme('light');
--code-background: $code-background;
--highlight-background: $highlight-background;
--highlight-foreground: $highlight-foreground;
--highlight-comment: $highlight-comment;
--highlight-red: $highlight-red;
--highlight-orange: $highlight-orange;
--highlight-yellow: $highlight-yellow;
--highlight-green: $highlight-green;
--highlight-aqua: $highlight-aqua;
--highlight-blue: $highlight-blue;
--highlight-purple: $highlight-purple;
--highlight-gutter-color: $highlight-gutter-color;
--highlight-gutter-bg-color: $highlight-gutter-bg-color;
} }
.night-code-theme { .night-code-theme {
--code-foreground: $night-code-foreground; code-theme('dark');
--code-background: $night-code-background;
--highlight-background: $night-highlight-background;
--highlight-foreground: $night-highlight-foreground;
--highlight-comment: $night-highlight-comment;
--highlight-red: $night-highlight-red;
--highlight-orange: $night-highlight-orange;
--highlight-yellow: $night-highlight-yellow;
--highlight-green: $night-highlight-green;
--highlight-aqua: $night-highlight-aqua;
--highlight-blue: $night-highlight-blue;
--highlight-purple: $night-highlight-purple;
--highlight-gutter-color: $night-highlight-gutter-color;
--highlight-gutter-bg-color: $night-highlight-gutter-bg-color;
} }

View File

@ -1,26 +1,27 @@
// ======================================================================== // ========================================================================================
// THEME VARIABLE // // KEEP THEME VARIABLE //
// ======================================================================== // ========================================================================================
// ========================================================================
// ========================================================================================
// layout // layout
// ======================================================================== // ========================================================================================
$header-height = 76px; // $header-height = 76px; //
$header-shrink-height = $header-height * 0.72; // $header-shrink-height = $header-height * 0.72; //
$header-progress-height = 2.8px; // $header-progress-height = 2.8px; //
$main-content-width = 80%; // PC $main-content-width = 80%; // PC
$main-content-width-tablet = 85%; // $main-content-width-tablet = 85%; //
$main-content-width-mobile = 90%; // $main-content-width-mobile = 90%; //
$circle-button-width = 40px; // tools $circle-button-width = 40px; // tools
$tools-button-width = 32px; // tools $tools-button-width = 32px; // tools
$component-interspace = 30px; // /PC $component-interspace = 30px; // /PC
$temp-content-max-width = hexo-config('style.content_max_width'); $temp-content-max-width = hexo-config('style.content_max_width');
$content-max-width = $temp-content-max-width ? convert($temp-content-max-width) : 1000px; $content-max-width = $temp-content-max-width ? convert($temp-content-max-width) : 1000px;
// ======================================================================== // ========================================================================================
// //
// ======================================================================== // ========================================================================================
$media-max-width = 780px; // () $media-max-width = 780px; // ()
$media-max-width-mobile = 500px; // $media-max-width-mobile = 500px; //
@ -33,9 +34,9 @@ keep-mobile()
{block} {block}
// ======================================================================== // ========================================================================================
// z-index // z-index
// ======================================================================== // ========================================================================================
$z-index-1 = 1001; $z-index-1 = 1001;
$z-index-2 = 1002; $z-index-2 = 1002;
$z-index-3 = 1003; $z-index-3 = 1003;
@ -47,15 +48,17 @@ $z-index-8 = 1008;
$z-index-9 = 1009; $z-index-9 = 1009;
// ======================================================================== // ========================================================================================
// color // color
// ======================================================================== // ========================================================================================
// primary color // primary color
$temp-color = hexo-config('style.primary_color'); $temp-color = hexo-config('style.primary_color');
$primary-color = $temp-color ? convert($temp-color) : #0066CC; $primary-color = $temp-color ? convert($temp-color) : #0066CC;
// ====================== light mode color ====================== // ========================================================================================
// light mode color
// ========================================================================================
$background-color = #fff; $background-color = #fff;
$second-background-color = darken($background-color, 3%); $second-background-color = darken($background-color, 3%);
$default-text-color = #505050; $default-text-color = #505050;
@ -73,7 +76,10 @@ $link-color = darken($default-text-color, 10%);
$copyright-info-color = #CC0033; $copyright-info-color = #CC0033;
$avatar-background-color = #0066CC; $avatar-background-color = #0066CC;
// ====================== dark mode color ======================
// ========================================================================================
// dark mode color
// ========================================================================================
$dark-primary-color = $primary-color; $dark-primary-color = $primary-color;
$dark-background-color = #363636; $dark-background-color = #363636;
$dark-second-background-color = darken($dark-background-color, 10%); $dark-second-background-color = darken($dark-background-color, 10%);
@ -92,6 +98,7 @@ $dark-link-color = lighten($dark-default-text-color, 10%);
$dark-copyright-info-color = darken($copyright-info-color, 20%); $dark-copyright-info-color = darken($copyright-info-color, 20%);
$dark-avatar-background-color = darken($avatar-background-color, 20%); $dark-avatar-background-color = darken($avatar-background-color, 20%);
// ======================================================================== // ========================================================================
// font // font
// ======================================================================== // ========================================================================

View File

@ -1,4 +1,7 @@
@import "layout/common/basic.styl" @import "common/basic.styl"
@import "common/markdown.styl"
@import "common/codeblock/highlight.styl"
@import "common/codeblock/copy-code.styl"
@import "layout/page.styl" @import "layout/page.styl"
@import "layout/_partial/local-search.styl" @import "layout/_partial/local-search.styl"
@import "layout/_partial/toc.styl" @import "layout/_partial/toc.styl"
@ -20,7 +23,4 @@
@import "layout/article-content.styl" @import "layout/article-content.styl"
@import "layout/category-content.styl" @import "layout/category-content.styl"
@import "layout/tag-content.styl" @import "layout/tag-content.styl"
@import "layout/common/markdown.styl"
@import "layout/common/codeblock/highlight.styl"
@import "layout/common/codeblock/copy-code.styl"
@import "layout/_partial/tagcloud.styl" @import "layout/_partial/tagcloud.styl"