feat: merge $admonition-color-map and $admonition-background-color-map

This commit is contained in:
Dillon
2022-05-16 21:57:03 +08:00
parent b79ebc8141
commit 464a602f11
8 changed files with 253 additions and 267 deletions

View File

@@ -2,20 +2,13 @@
position: relative;
margin: 1rem 0;
padding: 0 .75rem;
background-color: map-get($admonition-background-color-map, 'note');
border-left: .25rem solid map-get($admonition-color-map, 'note');
border-left: .25rem solid;
overflow: auto;
.admonition-title {
font-weight: bold;
margin: 0 -0.75rem;
padding: .25rem 1.8rem;
border-bottom: 1px solid map-get($admonition-background-color-map, 'note');
background-color: opacify(map-get($admonition-background-color-map, 'note'), 0.15);
}
&.open .admonition-title {
background-color: map-get($admonition-background-color-map, 'note');
}
.admonition-content {
@@ -24,7 +17,6 @@
i.icon {
font-size: 0.85rem;
color: map-get($admonition-color-map, 'note');
position: absolute;
top: .6rem;
left: .4rem;
@@ -36,27 +28,40 @@
right: .3rem;
}
@each $type, $color in $admonition-color-map {
&.#{$type} {
@each $type, $color, $background-color in $admonition-color-list {
@if $type == "note" {
background-color: $background-color;
border-left-color: $color;
.admonition-title {
border-bottom-color: $background-color;
background-color: opacify($background-color, 0.15);
}
&.open .admonition-title {
background-color: $background-color;
}
i.icon {
color: $color;
}
}
}
} @else {
&.#{$type} {
background-color: $background-color;
border-left-color: $color;
@each $type, $color in $admonition-background-color-map {
&.#{$type} {
background-color: $color;
.admonition-title {
border-bottom-color: $background-color;
background-color: opacify($background-color, 0.15);
}
.admonition-title {
border-bottom-color: $color;
background-color: opacify($color, 0.15);
}
&.open .admonition-title {
background-color: $background-color;
}
&.open .admonition-title {
background-color: $color;
i.icon {
color: $color;
}
}
}
}

View File

@@ -88,10 +88,10 @@ code, pre, .highlight table, .highlight tr, .highlight td {
.code-title::after {
padding-left: .2rem;
content: 'Code';
content: "Code";
}
@each $type, $text in $code-type-map {
@each $type, $text in $code-type-list {
&.#{$type} .code-title::after {
content: $text;
}
@@ -171,7 +171,7 @@ code, pre, .highlight table, .highlight tr, .highlight td {
}
.table-wrapper {
max-height: $MAX_LENGTH;
max-height: 10000px;
@include details-transition-close;
}

View File

@@ -68,7 +68,7 @@
.post-nav {
&::before,
&::after {
content: ' ';
content: " ";
display: table;
}

View File

@@ -50,7 +50,7 @@
#toc-auto {
display: block;
position: absolute;
width: $MAX_LENGTH;
width: 10000px;
max-width: 0;
padding: 0 .8rem;
border-left: 4px solid $global-border-color;