Refactor @import

This commit is contained in:
Mimi 2021-09-07 00:51:01 +08:00
parent 1be8cbb18b
commit 989157a853
24 changed files with 514 additions and 498 deletions

View File

@ -1,14 +0,0 @@
.back-to-top {
margin: 20px - $sidebar-offset -10px -20px;
opacity: 0;
transition: opacity $transition-ease;
&.back-to-top-on {
cursor: pointer;
opacity: $b2t-opacity;
&:hover {
opacity: $b2t-opacity-hover;
}
}
}

View File

@ -1,4 +1,27 @@
.back-to-top { if (hexo-config('back2top.enable')) {
.back-to-top {
font-size: $b2t-font-size;
if (not hexo-config('back2top.scrollpercent')) {
span {
display: none;
}
}
if (hexo-config('back2top.sidebar')) {
margin: 20px - $sidebar-offset -10px -20px;
opacity: 0;
transition: opacity $transition-ease;
&.back-to-top-on {
cursor: pointer;
opacity: $b2t-opacity;
&:hover {
opacity: $b2t-opacity-hover;
}
}
} else {
bottom: $b2t-position-bottom; bottom: $b2t-position-bottom;
box-sizing: border-box; box-sizing: border-box;
color: $b2t-color; color: $b2t-color;
@ -17,4 +40,6 @@
&.back-to-top-on { &.back-to-top-on {
bottom: $b2t-position-bottom-on; bottom: $b2t-position-bottom-on;
} }
}
}
} }

View File

@ -1,17 +1,3 @@
if (hexo-config('back2top.enable')) {
.back-to-top {
font-size: $b2t-font-size;
if (not hexo-config('back2top.scrollpercent')) {
span {
display: none;
}
}
}
@import (hexo-config('back2top.sidebar') ? 'back-to-top-sidebar' : 'back-to-top');
}
.noscript-warning { .noscript-warning {
background-color: lighten($red, 20%); background-color: lighten($red, 20%);
color: white; color: white;
@ -26,7 +12,8 @@ if (hexo-config('back2top.enable')) {
z-index: $zindex-5; z-index: $zindex-5;
} }
@import 'reading-progress' if (hexo-config('reading_progress.enable')); @import 'back-to-top';
@import 'reading-progress';
@import 'post'; @import 'post';
@import 'pages'; @import 'pages';

View File

@ -50,5 +50,4 @@
@import 'post-footer'; @import 'post-footer';
@import 'post-widgets'; @import 'post-widgets';
@import 'post-reward'; @import 'post-reward';
@import 'post-followme';
@import 'post-followme' if (hexo-config('follow_me'));

View File

@ -1,4 +1,5 @@
.followme { if (hexo-config('follow_me')) {
.followme {
color: $grey; color: $grey;
padding: 1em 1.5em; padding: 1em 1.5em;
text-align: center; text-align: center;
@ -30,4 +31,5 @@
} }
} }
} }
}
} }

View File

@ -1,4 +1,5 @@
.reading-progress-bar { if (hexo-config('reading_progress.enable')) {
.reading-progress-bar {
--progress: 0; --progress: 0;
background: unquote(hexo-config('reading_progress.color')); background: unquote(hexo-config('reading_progress.color'));
height: unquote(hexo-config('reading_progress.height')); height: unquote(hexo-config('reading_progress.height'));
@ -22,4 +23,5 @@
} else { } else {
top: 0; top: 0;
} }
}
} }

View File

@ -1,7 +1,9 @@
.gt-header a, .gt-comments a, .gt-popup a { if (hexo-config('gitalk.enable')) {
.gt-header a, .gt-comments a, .gt-popup a {
border-bottom: 0; border-bottom: 0;
} }
.gt-container .gt-popup .gt-action.is--active::before { .gt-container .gt-popup .gt-action.is--active::before {
top: .7em; top: .7em;
}
} }

View File

@ -1,12 +1,8 @@
@import 'gitalk' if (hexo-config('gitalk.enable')); @import 'gitalk';
@import 'utterances';
@import 'utterances' if (hexo-config('utterances.enable')); @import 'search';
@import 'related-posts';
@import 'search' if (hexo-config('local_search.enable') || hexo-config('algolia_search.enable')); @import 'math';
@import 'related-posts' if (hexo-config('related_posts.enable'));
@import 'math' if (hexo-config('math.mathjax.enable'));
.use-motion .animated { .use-motion .animated {
// Fix issue #48 #55 // Fix issue #48 #55

View File

@ -1,7 +1,9 @@
mjx-container[jax="CHTML"][display="true"], .has-jax { if (hexo-config('math.mathjax.enable')) {
mjx-container[jax="CHTML"][display="true"], .has-jax {
overflow: auto hidden; overflow: auto hidden;
} }
mjx-container[display="true"] + br { mjx-container[display="true"] + br {
display: none; display: none;
}
} }

View File

@ -1,11 +1,12 @@
.popular-posts-header { if (hexo-config('related_posts.enable')) {
.popular-posts-header {
border-bottom: 1px solid $gainsboro; border-bottom: 1px solid $gainsboro;
font-size: $font-size-large; font-size: $font-size-large;
margin-bottom: 10px; margin-bottom: 10px;
margin-top: $post-eof-margin-bottom; margin-top: $post-eof-margin-bottom;
} }
.popular-posts { .popular-posts {
padding: 0; padding: 0;
.popular-posts-item { .popular-posts-item {
@ -18,4 +19,5 @@
margin: 0; margin: 0;
} }
} }
}
} }

View File

@ -1,8 +1,9 @@
.search-active { if (hexo-config('local_search.enable') or hexo-config('algolia_search.enable')) {
.search-active {
overflow: hidden; overflow: hidden;
} }
.search-pop-overlay { .search-pop-overlay {
background: rgba(0, 0, 0, 0); background: rgba(0, 0, 0, 0);
display: flex; display: flex;
height: 100%; height: 100%;
@ -18,9 +19,9 @@
background: rgba(0, 0, 0, .3); background: rgba(0, 0, 0, .3);
visibility: visible; visibility: visible;
} }
} }
.search-popup { .search-popup {
background: var(--card-bg-color); background: var(--card-bg-color);
border-radius: 5px; border-radius: 5px;
height: 80%; height: 80%;
@ -99,6 +100,7 @@
border-bottom: 1px dashed $grey-light; border-bottom: 1px dashed $grey-light;
padding: 5px 0; padding: 5px 0;
} }
}
} }
if (hexo-config('algolia_search.enable')) { if (hexo-config('algolia_search.enable')) {

View File

@ -1,3 +1,5 @@
.utterances { if (hexo-config('utterances.enable')) {
.utterances {
max-width: unset; max-width: unset;
}
} }

View File

@ -1,4 +1,5 @@
.book-mark-link { if (hexo-config('bookmark.enable')) {
.book-mark-link {
border-bottom: 0; border-bottom: 0;
position: fixed; position: fixed;
top: -10px; top: -10px;
@ -15,8 +16,9 @@
line-height: 1; line-height: 1;
font-family-icons('\f02e'); font-family-icons('\f02e');
} }
} }
.book-mark-link:hover, .book-mark-link-fixed { .book-mark-link:hover, .book-mark-link-fixed {
top: -2px; top: -2px;
}
} }

View File

@ -1,4 +1,5 @@
@keyframes octocat-wave { if (hexo-config('github_banner.enable')) {
@keyframes octocat-wave {
0%, 100% { 0%, 100% {
transform: rotate(0); transform: rotate(0);
} }
@ -10,9 +11,9 @@
40%, 80% { 40%, 80% {
transform: rotate(10deg); transform: rotate(10deg);
} }
} }
.github-corner { .github-corner {
$bg-color = unquote(hexo-config('android_chrome_color')); $bg-color = unquote(hexo-config('android_chrome_color'));
:hover .octo-arm { :hover .octo-arm {
@ -56,4 +57,5 @@
} }
} }
} }
}
} }

View File

@ -33,6 +33,5 @@
@import 'site-nav'; @import 'site-nav';
@import 'menu'; @import 'menu';
@import 'bookmark' if (hexo-config('bookmark.enable')); @import 'bookmark';
@import 'github-banner';
@import 'github-banner' if (hexo-config('github_banner.enable'));

View File

@ -2,4 +2,4 @@
@import 'sidebar'; @import 'sidebar';
@import 'footer'; @import 'footer';
@import 'mobile' if (hexo-config('mobile_layout_economy')); @import 'mobile';

View File

@ -5,7 +5,8 @@
} }
*/ */
+mobile-small() { if (hexo-config('mobile_layout_economy')) {
+mobile-small() {
// For Pisces & Gemini schemes only wider width (remove main blocks in Gemini). // For Pisces & Gemini schemes only wider width (remove main blocks in Gemini).
.main-inner { .main-inner {
padding: initial !important; padding: initial !important;
@ -74,8 +75,8 @@
.pagination { .pagination {
margin-top: 40px; margin-top: 40px;
} }
}
} }
/* /*
// < 413px // < 413px
+mobile-smallest() { +mobile-smallest() {

View File

@ -34,7 +34,5 @@
@import 'sidebar-dimmer'; @import 'sidebar-dimmer';
@import 'sidebar-nav'; @import 'sidebar-nav';
@import 'sidebar-toggle'; @import 'sidebar-toggle';
@import 'sidebar-toc';
@import 'sidebar-toc' if (hexo-config('toc.enable')); @import 'site-state';
@import 'site-state' if (hexo-config('site_state'));

View File

@ -1,4 +1,5 @@
.post-toc { if (hexo-config('toc.enable')) {
.post-toc {
font-size: $font-size-small; font-size: $font-size-small;
ol { ol {
@ -56,4 +57,5 @@
} }
} }
} }
}
} }

View File

@ -1,9 +1,10 @@
.site-state { if (hexo-config('site_state')) {
.site-state {
flex-wrap(); flex-wrap();
line-height: 1.4; line-height: 1.4;
} }
.site-state-item { .site-state-item {
// Fix issue #103 // Fix issue #103
// The click area of the link becomes smaller // The click area of the link becomes smaller
padding: 0 15px; padding: 0 15px;
@ -12,15 +13,16 @@
border-bottom: 0; border-bottom: 0;
display: block; display: block;
} }
} }
.site-state-item-count { .site-state-item-count {
display: block; display: block;
font-size: $site-state-item-count-font-size; font-size: $site-state-item-count-font-size;
font-weight: 600; font-weight: 600;
} }
.site-state-item-name { .site-state-item-name {
color: $site-state-item-name-color; color: $site-state-item-name-color;
font-size: $site-state-item-name-font-size; font-size: $site-state-item-name-font-size;
}
} }

View File

@ -2,10 +2,7 @@
@import 'group-pictures'; @import 'group-pictures';
@import 'label'; @import 'label';
@import 'link-grid'; @import 'link-grid';
@import 'mermaid';
@import 'note';
@import 'pdf';
@import 'tabs'; @import 'tabs';
@import 'note' if (hexo-config('note.style') != 'disabled');
@import 'pdf' if (hexo-config('pdf.enable'));
@import 'mermaid' if (hexo-config('mermaid.enable'));

View File

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

View File

@ -1,4 +1,5 @@
.post-body .note { if (hexo-config('note.style') != 'disabled') {
.post-body .note {
$note-icons = hexo-config('note.icons'); $note-icons = hexo-config('note.icons');
$note-style = hexo-config('note.style'); $note-style = hexo-config('note.style');
@ -107,4 +108,5 @@
} }
} }
} }
}
} }

View File

@ -1,6 +1,8 @@
.pdfobject-container { if (hexo-config('pdf.enable')) {
.pdfobject-container {
iframe, embed { iframe, embed {
height: unquote(hexo-config('pdf.height')); height: unquote(hexo-config('pdf.height'));
width: 100%; width: 100%;
} }
}
} }