🔧 🚩 🚧 Finished the scaffolding variable replace content.

This commit is contained in:
凡梦星尘 2022-05-21 20:48:41 +08:00
parent 3165c7b566
commit ea3acab865
12 changed files with 57 additions and 43 deletions

View File

@ -18,7 +18,7 @@ body {
position: relative; position: relative;
transition: padding $transition-ease; transition: padding $transition-ease;
@if hexo-config('body_scrollbar.overlay') { @if $body_scrollbar_overlay {
overflow-x: hidden; overflow-x: hidden;
@supports (overflow-x: clip) { @supports (overflow-x: clip) {
overflow-x: clip; overflow-x: clip;
@ -26,7 +26,7 @@ body {
width: 100vw; width: 100vw;
} }
@if hexo-config('body_scrollbar.stable') { @if $body_scrollbar_stable {
overflow-y: scroll; overflow-y: scroll;
} }
} }

View File

@ -11,13 +11,13 @@
position: absolute; position: absolute;
transition: opacity $transition-ease; transition: opacity $transition-ease;
@if hexo-config('codeblock.copy_button.style') == 'flat' { @if $codeblock_copy_btn_style == 'flat' {
background: white; background: white;
border: 0; border: 0;
font-size: $font-size-smaller; font-size: $font-size-smaller;
right: 0; right: 0;
top: 0; top: 0;
} @else if hexo-config('codeblock.copy_button.style') == 'mac' { } @else if $codeblock_copy_btn_style == 'mac' {
color: var(--highlight-foreground); color: var(--highlight-foreground);
font-size: 14px; font-size: 14px;
right: 0; right: 0;
@ -33,7 +33,7 @@
} }
} }
@if hexo-config('codeblock.copy_button.style') == 'mac' { @if $codeblock_copy_btn_style == 'mac' {
figure.highlight { figure.highlight {
border-radius: 5px; border-radius: 5px;
box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4); box-shadow: 0 10px 30px 0 rgba(0, 0, 0, .4);

View File

@ -1,14 +1,15 @@
// Use `@use` to fix issue #67 // Use `@use` to fix issue #67
@import '(theme.highlight.enable && theme.highlight.light.file) ? theme.highlight.light.file : null'; // TODO find way to import file by dynmatic
@import '(theme.prism.enable && theme.prism.light) ? theme.prism.light : null'; // @import '(theme.highlight.enable && theme.highlight.light.file) ? theme.highlight.light.file : null';
@import '(theme.prism.enable && theme.prism.number) ? theme.prism.number : null'; // @import '(theme.prism.enable && theme.prism.light) ? theme.prism.light : null';
// @import '(theme.prism.enable && theme.prism.number) ? theme.prism.number : null';
@media (prefers-color-scheme: dark) { /* @media (prefers-color-scheme: dark) {
@import '(theme.darkmode && theme.highlight.enable && theme.highlight.dark.file) ? theme.highlight.dark.file : null'; @import '(theme.darkmode && theme.highlight.enable && theme.highlight.dark.file) ? theme.highlight.dark.file : null';
@import '(theme.darkmode && theme.prism.enable && theme.prism.dark) ? theme.prism.dark : null'; @import '(theme.darkmode && theme.prism.enable && theme.prism.dark) ? theme.prism.dark : null';
} } */
@import 'theme.codeblock.copy_button.enable ? "copy-code" : null'; // @import 'theme.codeblock.copy_button.enable ? "copy-code" : null';
// Placeholder: %code-inline %code-block // Placeholder: %code-inline %code-block
%code-inline { %code-inline {

View File

@ -1,4 +1,4 @@
@use 'sass:map'; //@use 'sass:map';
.post-body .label { .post-body .label {
color: $text-color; color: $text-color;
@ -6,7 +6,7 @@
@each $type in $note-types { @each $type in $note-types {
&.#{$type} { &.#{$type} {
background: map.get($label, $type); background: map-get($label, $type);
} }
} }
} }

View File

@ -1,4 +1,4 @@
@if hexo-config('mermaid.enable') { @if $mermaid_enable {
.mermaid { .mermaid {
margin-bottom: 20px; margin-bottom: 20px;
text-align: center; text-align: center;

View File

@ -1,9 +1,9 @@
@use 'sass:map'; //@use 'sass:map';
@if hexo-config('note.style') != 'disabled' { @if $note_style != 'disabled' {
.post-body .note { .post-body .note {
$note-icons : hexo-config('note.icons'); $note-icons : $note_icons;
$note-style : hexo-config('note.style'); $note-style : $note_style;
border-radius: $note-border-radius; border-radius: $note-border-radius;
margin-bottom: 20px; margin-bottom: 20px;
@ -67,44 +67,44 @@
@each $type in $note-types { @each $type in $note-types {
&.#{$type} { &.#{$type} {
@if $note-style == 'flat' { @if $note-style == 'flat' {
background: map.get($note-bg, $type); background: map-get($note-bg, $type);
@if hexo-config('darkmode') { @if $darkmode {
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
background: mix(map.get($note-bg, $type), $body-bg-color-dark, 10%); background: mix(map-get($note-bg, $type), $body-bg-color-dark, 10%);
} }
} }
} }
@if $note-style == 'modern' { @if $note-style == 'modern' {
background: map.get($note-modern-bg, $type); background: map-get($note-modern-bg, $type);
border-color: map.get($note-modern-border, $type); border-color: map-get($note-modern-border, $type);
color: map.get($note-modern-text, $type); color: map-get($note-modern-text, $type);
a:not(.btn) { a:not(.btn) {
border-bottom-color: map.get($note-modern-text, $type); border-bottom-color: map-get($note-modern-text, $type);
color: map.get($note-modern-text, $type); color: map-get($note-modern-text, $type);
&:hover { &:hover {
border-bottom-color: map.get($note-modern-hover, $type); border-bottom-color: map-get($note-modern-hover, $type);
color: map.get($note-modern-hover, $type); color: map-get($note-modern-hover, $type);
} }
} }
} }
@if $note-style != 'modern' { @if $note-style != 'modern' {
border-left-color: map.get($note-border, $type); border-left-color: map-get($note-border, $type);
h2, h3, h4, h5, h6 { h2, h3, h4, h5, h6 {
color: map.get($note-text, $type); color: map-get($note-text, $type);
} }
} }
@if $note-icons { @if $note-icons {
&:not(.no-icon)::before { &:not(.no-icon)::before {
@include font-family-icons(map.get($note-icon, $type)); @include font-family-icons(map-get($note-icon, $type));
@if $note-style != 'modern' { @if $note-style != 'modern' {
color: map.get($note-text, $type); color: map-get($note-text, $type);
} }
} }
} }

View File

@ -1,7 +1,7 @@
@if hexo-config('pdf.enable') { @if $pdf_enable {
.pdfobject-container { .pdfobject-container {
iframe, embed { iframe, embed {
height: convert(hexo-config('pdf.height')); height: convert($pdf_height);
width: 100%; width: 100%;
} }
} }

View File

@ -42,7 +42,7 @@
border-radius: $tbr; border-radius: $tbr;
} }
@if hexo-config('tabs.transition.tabs') { @if $tabs_transition_tabs {
transition: all $transition-ease-out; transition: all $transition-ease-out;
} }
@ -57,7 +57,7 @@
width: (18em / 14); width: (18em / 14);
} }
@if hexo-config('tabs.transition.labels') { @if $tabs_transition_labels {
transition: all $transition-ease-out; transition: all $transition-ease-out;
} }
} }

View File

@ -18,9 +18,9 @@
} }
.toggle.toggle-arrow { .toggle.toggle-arrow {
@include toggle-arrow(hexo-config('sidebar.position')); @include toggle-arrow($sidebar_position);
} }
.toggle.toggle-close { .toggle.toggle-close {
@include toggle-close(hexo-config('sidebar.position')); @include toggle-close($sidebar_position);
} }

View File

@ -4,9 +4,13 @@
// Base // Base
$scheme: {{ $P.scheme }}; $scheme: {{ $P.scheme }};
$darkmode: {{ $P.darkmode }}; $darkmode: {{ $P.darkmode }};
$body_scrollbar_overlay: {{ $P.bodyScrollbar.overlay }};
$body_scrollbar_stable: {{ $P.bodyScrollbar.stable }};
$mermaid_enable: {{ $P.mermaid.enable }};
$mobile_layout_economy: {{ $P.mobileLayoutEconomy }};
$theme_color_dark: {{ $P.themeColor.dark }}; $theme_color_dark: {{ $P.themeColor.dark }};
$theme_color_light: {{ $P.themeColor.light }}; $theme_color_light: {{ $P.themeColor.light }};
$mobile_layout_economy: {{ $P.mobileLayoutEconomy }};
// Header // Header
$bookmark_enable: {{ $P.bookmark.enable }}; $bookmark_enable: {{ $P.bookmark.enable }};
@ -36,6 +40,8 @@ $highlight_dark_foreground: #222;
$highlight_light_background: #000; $highlight_light_background: #000;
$highlight_light_foreground: #222; $highlight_light_foreground: #222;
$codeblock_copy_btn_style: {{ $P.codeblock.copyBtn.style }};
// Sidebar // Sidebar
$sidebar_offset: {{ $P.sidebar.offset }}; $sidebar_offset: {{ $P.sidebar.offset }};
$sidebar_padding: {{ $P.sidebar.padding }}; $sidebar_padding: {{ $P.sidebar.padding }};
@ -52,8 +58,13 @@ $toc_expand_all: {{ $P.toc.expandAll }};
$toc_wrap: {{ $P.toc.wrap }}; $toc_wrap: {{ $P.toc.wrap }};
// Note // Note
$note_light_bg_offset: {{ $P.note.lightBgOffset }};
$note_icons: {{ $P.note.icons }}; $note_icons: {{ $P.note.icons }};
$note_light_bg_offset: {{ $P.note.lightBgOffset }};
$note_style: {{ $P.note.style }};
// Tabs
$tabs_transition_labels: {{ $P.tabs.transition.labels }};
$tabs_transition_tabs: {{ $P.tabs.transition.tabs }};
// Reading progress bar // Reading progress bar
$reading_progress_start: {{ $P.readingProgress.start }}; $reading_progress_start: {{ $P.readingProgress.start }};
@ -66,6 +77,8 @@ $reading_progress_reversed: {{ $P.readingProgress.reversed }};
// Thirdparty // Thirdparty
$math_mathjax_enable: {{ $P.math.mathjax.enable }}; $math_mathjax_enable: {{ $P.math.mathjax.enable }};
$related_posts_enable: {{ $P.relatedPosts.enable }}; $related_posts_enable: {{ $P.relatedPosts.enable }};
$pdf_enable: {{ $P.pdf.enable }};
$pdf_height: {{ $P.pdf.height }};
// Search engine // Search engine
$algolia_search_enable: {{ $P.algoliaSearch.enable }}; $algolia_search_enable: {{ $P.algoliaSearch.enable }};

View File

@ -24,7 +24,7 @@
// -------------------------------------------------- // --------------------------------------------------
// Scaffolding // Scaffolding
// @import '_common/scaffolding'; @import '_common/scaffolding';
// Layout // Layout
@import '_common/outline'; @import '_common/outline';

View File

@ -360,7 +360,7 @@ params:
dark: "#222" dark: "#222"
# Override browsers' default behavior. # Override browsers' default behavior.
body_scrollbar: bodyScrollbar:
# Place the scrollbar over the content. # Place the scrollbar over the content.
overlay: false overlay: false
# Present the scrollbar even if the content is not overflowing. # Present the scrollbar even if the content is not overflowing.
@ -379,7 +379,7 @@ params:
copyBtn: copyBtn:
enable: false enable: false
# Available values: default | flat | mac # Available values: default | flat | mac
style: style: default
back2top: back2top:
enable: true enable: true