docs-v2/assets/styles/layouts/article/_expand.scss

81 lines
1.3 KiB
SCSS

// Styles for accordion-like expandable content blocks
.expand-wrapper {
margin: 2rem 0 2rem;
}
h5, h6 {
&+ .expand-wrapper { margin-top: .75rem;}
}
.expand {
position: relative;
border-top: 1px solid $article-hr;
padding: .75rem 0;
&:last-of-type, &:only-child { border-bottom: 1px solid $article-hr; }
}
.expand-label {
display: flex;
align-items: center;
font-weight: bold;
margin-bottom: 0;
padding-right: 2.5rem;
cursor: pointer;
&:hover {
.expand-toggle { background: $b-laser; }
}
}
.expand-link {
display: block;
position: absolute;
top: 1rem;
right: .75rem;
min-height: 20px;
min-width: 20px;
font-size: 1.25rem;
color: $article-bold;
opacity: .3;
transition: opacity .2s;
&:hover {
color: $article-bold;
opacity: 1;
}
}
.expand-toggle {
position: relative;
display: inline-block;
min-height: 20px;
min-width: 20px;
background: $b-dodger;
border-radius: 50%;
margin-right: .75rem;
transition: background-color .2s;
&:before, &:after {
content: "";
display: block;
width: 10px;
height: 2px;
position: absolute;
background: $article-bg;
transition: all .4s;
top: 9px;
left: 5px;
}
&:after {
transform: rotate(90deg);
}
&.open {
&:before, &:after { transform: rotate(180deg); }
}
}
.expand-content {
padding-top: 1rem;
}