Refactor @extend

This commit is contained in:
Mimi 2021-09-06 23:46:46 +08:00
parent 61048546ca
commit 1be8cbb18b
4 changed files with 28 additions and 24 deletions

View File

@ -132,7 +132,7 @@ if (hexo-config('algolia_search.enable')) {
} }
.current .page-number { .current .page-number {
@extend .pagination .page-number.current; @extend $page-number-current;
cursor: default; cursor: default;
} }

View File

@ -10,10 +10,6 @@
background: $sidebar-highlight; background: $sidebar-highlight;
} }
// Fix issue #75
// @extends does not seem to work inside @media
// So we use a mixin here
// https://github.com/stylus/stylus/issues/609
@media (any-hover: hover) { @media (any-hover: hover) {
body:not(.sidebar-active) .sidebar-toggle:hover { body:not(.sidebar-active) .sidebar-toggle:hover {
toggle-arrow(hexo-config('sidebar.position')); toggle-arrow(hexo-config('sidebar.position'));

View File

@ -26,6 +26,24 @@ $code-block {
margin: 0 auto 20px; margin: 0 auto 20px;
} }
$figcaption {
background: var(--highlight-gutter-background);
color: var(--highlight-foreground);
display: flow-root;
font-size: $table-font-size;
line-height: 1.2;
padding: .5em;
a {
color: var(--highlight-foreground);
float: right;
&:hover {
border-bottom-color: var(--highlight-foreground);
}
}
}
pre, code { pre, code {
font-family: $code-font-family; font-family: $code-font-family;
} }
@ -72,21 +90,7 @@ figure.highlight {
} }
figcaption { figcaption {
background: var(--highlight-gutter-background); @extend $figcaption;
color: var(--highlight-foreground);
display: flow-root;
font-size: $table-font-size;
line-height: 1.2;
padding: .5em;
a {
color: var(--highlight-foreground);
float: right;
&:hover {
border-bottom-color: var(--highlight-foreground);
}
}
} }
.gutter { .gutter {
@ -109,7 +113,7 @@ figure.highlight {
// See https://github.com/hexojs/hexo-util/pull/229 // See https://github.com/hexojs/hexo-util/pull/229
pre .caption, pre figcaption { pre .caption, pre figcaption {
@extend figure.highlight figcaption; @extend $figcaption;
margin-bottom: 10px; margin-bottom: 10px;
} }

View File

@ -8,6 +8,12 @@ $page-number-basic {
} }
} }
$page-number-current {
background: $pagination-active-bg;
border-color: $pagination-active-border;
color: $pagination-active-color;
}
.pagination { .pagination {
border-top: 1px solid $pagination-border; border-top: 1px solid $pagination-border;
margin: 120px 0 0; margin: 120px 0 0;
@ -44,8 +50,6 @@ $page-number-basic {
} }
.page-number.current { .page-number.current {
background: $pagination-active-bg; @extend $page-number-current;
border-color: $pagination-active-border;
color: $pagination-active-color;
} }
} }