From 3d6cbe98ca6675de5a6e21503ae151025b0b8af0 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 29 Nov 2020 01:38:13 +0800 Subject: [PATCH] Code style update --- .gitignore | 3 --- .../{components.styl => index.styl} | 0 .../outline/{outline.styl => index.styl} | 0 .../{scaffolding.styl => index.styl} | 0 source/css/_schemes/index.styl | 1 + source/css/_variables/Gemini.styl | 2 +- source/css/_variables/Mist.styl | 2 +- source/css/_variables/base.styl | 18 +++++++++--------- source/css/_variables/index.styl | 4 ++++ source/css/main.styl | 19 ++++++++----------- 10 files changed, 24 insertions(+), 25 deletions(-) rename source/css/_common/components/{components.styl => index.styl} (100%) rename source/css/_common/outline/{outline.styl => index.styl} (100%) rename source/css/_common/scaffolding/{scaffolding.styl => index.styl} (100%) create mode 100644 source/css/_schemes/index.styl create mode 100644 source/css/_variables/index.styl diff --git a/.gitignore b/.gitignore index 67c7cd9..ee3f9d8 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,3 @@ yarn.lock package-lock.json node_modules/ - -# Ignore optional external libraries -source/lib/* diff --git a/source/css/_common/components/components.styl b/source/css/_common/components/index.styl similarity index 100% rename from source/css/_common/components/components.styl rename to source/css/_common/components/index.styl diff --git a/source/css/_common/outline/outline.styl b/source/css/_common/outline/index.styl similarity index 100% rename from source/css/_common/outline/outline.styl rename to source/css/_common/outline/index.styl diff --git a/source/css/_common/scaffolding/scaffolding.styl b/source/css/_common/scaffolding/index.styl similarity index 100% rename from source/css/_common/scaffolding/scaffolding.styl rename to source/css/_common/scaffolding/index.styl diff --git a/source/css/_schemes/index.styl b/source/css/_schemes/index.styl new file mode 100644 index 0000000..f0c3876 --- /dev/null +++ b/source/css/_schemes/index.styl @@ -0,0 +1 @@ +@import $scheme; diff --git a/source/css/_variables/Gemini.styl b/source/css/_variables/Gemini.styl index cce60d5..e8ff7e4 100644 --- a/source/css/_variables/Gemini.styl +++ b/source/css/_variables/Gemini.styl @@ -1,7 +1,7 @@ // Variables of Gemini scheme // ================================================== -@import "Pisces.styl"; +@import 'Pisces'; // Settings for some of the most global styles. // -------------------------------------------------- diff --git a/source/css/_variables/Mist.styl b/source/css/_variables/Mist.styl index a892a96..49f85f7 100644 --- a/source/css/_variables/Mist.styl +++ b/source/css/_variables/Mist.styl @@ -1,7 +1,7 @@ // Variables of Mist scheme // ================================================== -@import "Muse.styl"; +@import 'Muse'; $content-padding-bottom = 80px; $posts-first-padding = 80px; diff --git a/source/css/_variables/base.styl b/source/css/_variables/base.styl index 3c77d92..7df47e7 100644 --- a/source/css/_variables/base.styl +++ b/source/css/_variables/base.styl @@ -75,7 +75,7 @@ get_font_family(config) { } // Font families. -$font-family-chinese = "PingFang SC", "Microsoft YaHei"; +$font-family-chinese = 'PingFang SC', 'Microsoft YaHei'; $font-family-base = $font-family-chinese, sans-serif; $font-family-base = get_font_family('global'), $font-family-chinese, sans-serif if get_font_family('global'); @@ -281,8 +281,8 @@ $post-card-margin = 1em 0 0; // Note colors // -------------------------------------------------- -// Read note light_bg_offset from NexT config and set in "$lbg%" to use it as string variable. -$lbg = hexo-config('note.light_bg_offset') is a 'unit' ? unit(hexo-config('note.light_bg_offset'), "%") : 0; +// Read note light_bg_offset from NexT config and set in '$lbg%' to use it as string variable. +$lbg = hexo-config('note.light_bg_offset') is a 'unit' ? unit(hexo-config('note.light_bg_offset'), '%') : 0; $note-types = 'default' 'primary' 'info' 'success' 'warning' 'danger'; // Default @@ -291,7 +291,7 @@ $note-border-radius = 3px; $note-border-default = #777; $note-bg-default = lighten(spin($note-border-default, 0), 94% + $lbg); $note-text-default = $note-border-default; -$note-icon-default = "\f0a9"; +$note-icon-default = '\f0a9'; $note-modern-border-default = #e1e1e1; $note-modern-bg-default = lighten(spin($note-modern-border-default, 10), 60% + ($lbg * 4)); @@ -302,7 +302,7 @@ $note-modern-hover-default = darken(spin($note-modern-text-default, -10), 32%); $note-border-primary = #6f42c1; $note-bg-primary = lighten(spin($note-border-primary, 10), 92% + $lbg); $note-text-primary = $note-border-primary; -$note-icon-primary = "\f055"; +$note-icon-primary = '\f055'; $note-modern-border-primary = #e1c2ff; $note-modern-bg-primary = lighten(spin($note-modern-border-primary, 10), 40% + ($lbg * 4)); @@ -313,7 +313,7 @@ $note-modern-hover-primary = darken(spin($note-modern-text-primary, -10), 22%); $note-border-info = #428bca; $note-bg-info = lighten(spin($note-border-info, -10), 91% + $lbg); $note-text-info = $note-border-info; -$note-icon-info = "\f05a"; +$note-icon-info = '\f05a'; $note-modern-border-info = #b3e5ef; $note-modern-bg-info = lighten(spin($note-modern-border-info, 10), 50% + ($lbg * 4)); @@ -324,7 +324,7 @@ $note-modern-hover-info = darken(spin($note-modern-text-info, -10), 32%); $note-border-success = #5cb85c; $note-bg-success = lighten(spin($note-border-success, 10), 90% + $lbg); $note-text-success = $note-border-success; -$note-icon-success = "\f058"; +$note-icon-success = '\f058'; $note-modern-border-success = #d0e6be; $note-modern-bg-success = lighten(spin($note-modern-border-success, 10), 40% + ($lbg * 4)); @@ -335,7 +335,7 @@ $note-modern-hover-success = darken(spin($note-modern-text-success, -10), 27%); $note-border-warning = #f0ad4e; $note-bg-warning = lighten(spin($note-border-warning, 10), 88% + $lbg); $note-text-warning = $note-border-warning; -$note-icon-warning = "\f06a"; +$note-icon-warning = '\f06a'; $note-modern-border-warning = #fae4cd; $note-modern-bg-warning = lighten(spin($note-modern-border-warning, 10), 43% + ($lbg * 4)); @@ -346,7 +346,7 @@ $note-modern-hover-warning = darken(spin($note-modern-text-warning, -10), 18%); $note-border-danger = #d9534f; $note-bg-danger = lighten(spin($note-border-danger, -10), 92% + $lbg); $note-text-danger = $note-border-danger; -$note-icon-danger = "\f056"; +$note-icon-danger = '\f056'; $note-modern-border-danger = #ebcdd2; $note-modern-bg-danger = lighten(spin($note-modern-border-danger, 10), 35% + ($lbg * 4)); diff --git a/source/css/_variables/index.styl b/source/css/_variables/index.styl new file mode 100644 index 0000000..a049ff1 --- /dev/null +++ b/source/css/_variables/index.styl @@ -0,0 +1,4 @@ +$variables = base $scheme; + +for $variable in $variables + @import $variable; diff --git a/source/css/main.styl b/source/css/main.styl index 4102223..192fd04 100644 --- a/source/css/main.styl +++ b/source/css/main.styl @@ -1,44 +1,41 @@ // CSS Style Guide: https://codeguide.co/#css -$scheme = hexo-config('scheme') ? hexo-config('scheme') : 'Muse'; - -$variables = base $scheme; +$scheme = hexo-config('scheme') ? hexo-config('scheme') : 'Muse'; // Variables Layer // -------------------------------------------------- -for $variable in $variables - @import "_variables/" + $variable; +@import '_variables'; for $inject_variable in hexo-config('injects.variable') @import $inject_variable; // Mixins Layer // -------------------------------------------------- -@import "_mixins.styl"; +@import '_mixins'; for $inject_mixin in hexo-config('injects.mixin') @import $inject_mixin; // Dark mode colors // -------------------------------------------------- -@import "_colors.styl"; +@import '_colors'; // Common Layer // -------------------------------------------------- // Scaffolding -@import "_common/scaffolding"; +@import '_common/scaffolding'; // Layout -@import "_common/outline"; +@import '_common/outline'; // Components -@import "_common/components"; +@import '_common/components'; // Schemes Layer // -------------------------------------------------- -@import "_schemes/" + $scheme; +@import '_schemes'; // Custom Layer