diff --git a/assets/css/_common/scaffolding/base.scss b/assets/css/_common/scaffolding/base.scss index 610ead2..3f3e049 100644 --- a/assets/css/_common/scaffolding/base.scss +++ b/assets/css/_common/scaffolding/base.scss @@ -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; } } diff --git a/assets/css/_common/scaffolding/highlight/copy-code.scss b/assets/css/_common/scaffolding/highlight/copy-code.scss index b350a2c..0b28ff4 100644 --- a/assets/css/_common/scaffolding/highlight/copy-code.scss +++ b/assets/css/_common/scaffolding/highlight/copy-code.scss @@ -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); diff --git a/assets/css/_common/scaffolding/highlight/index.scss b/assets/css/_common/scaffolding/highlight/index.scss index 106e21e..caad07d 100644 --- a/assets/css/_common/scaffolding/highlight/index.scss +++ b/assets/css/_common/scaffolding/highlight/index.scss @@ -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 { diff --git a/assets/css/_common/scaffolding/tags/label.scss b/assets/css/_common/scaffolding/tags/label.scss index e4c953c..44d464b 100644 --- a/assets/css/_common/scaffolding/tags/label.scss +++ b/assets/css/_common/scaffolding/tags/label.scss @@ -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); } } } diff --git a/assets/css/_common/scaffolding/tags/mermaid.scss b/assets/css/_common/scaffolding/tags/mermaid.scss index 22ff864..ab8b522 100644 --- a/assets/css/_common/scaffolding/tags/mermaid.scss +++ b/assets/css/_common/scaffolding/tags/mermaid.scss @@ -1,4 +1,4 @@ -@if hexo-config('mermaid.enable') { +@if $mermaid_enable { .mermaid { margin-bottom: 20px; text-align: center; diff --git a/assets/css/_common/scaffolding/tags/note.scss b/assets/css/_common/scaffolding/tags/note.scss index d95d39a..877e097 100644 --- a/assets/css/_common/scaffolding/tags/note.scss +++ b/assets/css/_common/scaffolding/tags/note.scss @@ -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); } } } diff --git a/assets/css/_common/scaffolding/tags/pdf.scss b/assets/css/_common/scaffolding/tags/pdf.scss index a08d9cb..e61cad9 100644 --- a/assets/css/_common/scaffolding/tags/pdf.scss +++ b/assets/css/_common/scaffolding/tags/pdf.scss @@ -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%; } } diff --git a/assets/css/_common/scaffolding/tags/tabs.scss b/assets/css/_common/scaffolding/tags/tabs.scss index 5ce758c..5c0217c 100644 --- a/assets/css/_common/scaffolding/tags/tabs.scss +++ b/assets/css/_common/scaffolding/tags/tabs.scss @@ -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; } } diff --git a/assets/css/_common/scaffolding/toggles.scss b/assets/css/_common/scaffolding/toggles.scss index 54cd930..bbc3c0d 100644 --- a/assets/css/_common/scaffolding/toggles.scss +++ b/assets/css/_common/scaffolding/toggles.scss @@ -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); } diff --git a/assets/css/_sitevars.scss b/assets/css/_sitevars.scss index 6175977..28bd92b 100644 --- a/assets/css/_sitevars.scss +++ b/assets/css/_sitevars.scss @@ -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 }}; diff --git a/assets/css/main.scss b/assets/css/main.scss index 0fb4ff5..19af1fd 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -24,7 +24,7 @@ // -------------------------------------------------- // Scaffolding -// @import '_common/scaffolding'; +@import '_common/scaffolding'; // Layout @import '_common/outline'; diff --git a/exampleSite/config.yaml b/exampleSite/config.yaml index ad6a517..4b21365 100644 --- a/exampleSite/config.yaml +++ b/exampleSite/config.yaml @@ -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