feat(code): add support for code block folding (#259)

This commit is contained in:
Dillon
2020-04-26 03:25:10 +08:00
committed by GitHub
parent 41a92c6166
commit bcbc4268ea
32 changed files with 351 additions and 270 deletions

View File

@@ -9,23 +9,32 @@
.admonition-title {
margin: 0 -0.75rem;
padding: .2rem .75rem .2rem 1.8rem;
border-bottom: .05rem solid map-get($admonition-background-color-map, 'note');
border-bottom: 1px solid map-get($admonition-background-color-map, 'note');
background-color: map-get($admonition-background-color-map, 'note');
}
.details-summary.admonition-title:hover {
background-color: darken(map-get($admonition-background-color-map, 'note'), 6%);
}
.admonition-content {
margin: .5rem 0;
padding: .5rem 0;
}
i.icon {
font-size: 0.85rem;
color: map-get($admonition-color-map, 'note');
cursor: auto;
position: absolute;
left: .6rem;
top: .6rem;
}
i.details-icon {
position: absolute;
top: .5rem;
right: .5rem;
}
@each $type, $color in $admonition-color-map {
&.#{$type} {
border-left-color: $color;
@@ -44,6 +53,10 @@
border-bottom-color: $color;
background-color: $color;
}
.details-summary.admonition-title:hover {
background-color: darken($color, 6%);
}
}
}
@@ -51,32 +64,3 @@
margin-bottom: .75rem;
}
}
details.admonition {
summary {
display: block;
outline: none;
cursor: pointer;
&::-webkit-details-marker {
display: none;
}
i.details {
position: absolute;
top: .5rem;
right: .5rem;
color: $global-font-color;
.dark & {
color: $global-font-color-dark;
}
}
}
}
details.admonition[open] {
i.details {
@include transform(rotate(180deg));
}
}