🔧 🚩 🚧 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;
transition: padding $transition-ease;
@if hexo-config('body_scrollbar.overlay') {
@if $body_scrollbar_overlay {
overflow-x: hidden;
@supports (overflow-x: clip) {
overflow-x: clip;
@ -26,7 +26,7 @@ body {
width: 100vw;
}
@if hexo-config('body_scrollbar.stable') {
@if $body_scrollbar_stable {
overflow-y: scroll;
}
}

View File

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

View File

@ -1,14 +1,15 @@
// Use `@use` to fix issue #67
@import '(theme.highlight.enable && theme.highlight.light.file) ? theme.highlight.light.file : null';
@import '(theme.prism.enable && theme.prism.light) ? theme.prism.light : null';
@import '(theme.prism.enable && theme.prism.number) ? theme.prism.number : null';
// TODO find way to import file by dynmatic
// @import '(theme.highlight.enable && theme.highlight.light.file) ? theme.highlight.light.file : 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.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
%code-inline {

View File

@ -1,4 +1,4 @@
@use 'sass:map';
//@use 'sass:map';
.post-body .label {
color: $text-color;
@ -6,7 +6,7 @@
@each $type in $note-types {
&.#{$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 {
margin-bottom: 20px;
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 {
$note-icons : hexo-config('note.icons');
$note-style : hexo-config('note.style');
$note-icons : $note_icons;
$note-style : $note_style;
border-radius: $note-border-radius;
margin-bottom: 20px;
@ -67,44 +67,44 @@
@each $type in $note-types {
&.#{$type} {
@if $note-style == 'flat' {
background: map.get($note-bg, $type);
@if hexo-config('darkmode') {
background: map-get($note-bg, $type);
@if $darkmode {
@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' {
background: map.get($note-modern-bg, $type);
border-color: map.get($note-modern-border, $type);
color: map.get($note-modern-text, $type);
background: map-get($note-modern-bg, $type);
border-color: map-get($note-modern-border, $type);
color: map-get($note-modern-text, $type);
a:not(.btn) {
border-bottom-color: map.get($note-modern-text, $type);
color: map.get($note-modern-text, $type);
border-bottom-color: map-get($note-modern-text, $type);
color: map-get($note-modern-text, $type);
&:hover {
border-bottom-color: map.get($note-modern-hover, $type);
color: map.get($note-modern-hover, $type);
border-bottom-color: map-get($note-modern-hover, $type);
color: map-get($note-modern-hover, $type);
}
}
}
@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 {
color: map.get($note-text, $type);
color: map-get($note-text, $type);
}
}
@if $note-icons {
&: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' {
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 {
iframe, embed {
height: convert(hexo-config('pdf.height'));
height: convert($pdf_height);
width: 100%;
}
}

View File

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

View File

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

View File

@ -4,9 +4,13 @@
// Base
$scheme: {{ $P.scheme }};
$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_light: {{ $P.themeColor.light }};
$mobile_layout_economy: {{ $P.mobileLayoutEconomy }};
// Header
$bookmark_enable: {{ $P.bookmark.enable }};
@ -36,6 +40,8 @@ $highlight_dark_foreground: #222;
$highlight_light_background: #000;
$highlight_light_foreground: #222;
$codeblock_copy_btn_style: {{ $P.codeblock.copyBtn.style }};
// Sidebar
$sidebar_offset: {{ $P.sidebar.offset }};
$sidebar_padding: {{ $P.sidebar.padding }};
@ -52,8 +58,13 @@ $toc_expand_all: {{ $P.toc.expandAll }};
$toc_wrap: {{ $P.toc.wrap }};
// Note
$note_light_bg_offset: {{ $P.note.lightBgOffset }};
$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_start: {{ $P.readingProgress.start }};
@ -66,6 +77,8 @@ $reading_progress_reversed: {{ $P.readingProgress.reversed }};
// Thirdparty
$math_mathjax_enable: {{ $P.math.mathjax.enable }};
$related_posts_enable: {{ $P.relatedPosts.enable }};
$pdf_enable: {{ $P.pdf.enable }};
$pdf_height: {{ $P.pdf.height }};
// Search engine
$algolia_search_enable: {{ $P.algoliaSearch.enable }};

View File

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

View File

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