Repo for my website
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

125 lines
2.8 KiB

.collapsible-block {
position: relative;
width: 100%;
margin: 40px 0;
input[type="checkbox"] {
position: absolute;
visibility: hidden;
}
&__content {
max-height: 80vh;
overflow: auto;
transition: max-height 0.15s ease, padding-top 0.15s ease,
padding-bottom 0.15s ease;
border-bottom-left-radius: 10px;
border-bottom-right-radius: 10px;
background-color: lighten($light-background-secondary, 5%);
.dark-theme & {
background-color: darken($dark-background-secondary, 6%);
}
padding: 0 1em;
&:has(> :last-child:nth-child(1)),
&:not(:has(*)) {
padding: 1em;
}
&:has(.highlight) {
padding: 0 !important;
}
}
input[type="checkbox"]:checked {
~ .collapsible-block__content {
max-height: 0;
padding-top: 0;
padding-bottom: 0;
border-top: none;
overflow: hidden;
}
~ label {
border-radius: 10px;
transition: border-radius 0.15s ease 0.1s;
}
~ label .collapsible-block__toggle:after {
content: attr(data-label-expand);
}
}
label {
position: relative;
display: flex;
justify-content: space-between;
background: $light-background-secondary;
padding: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
min-width: 30px;
min-height: 30px;
margin: 0;
cursor: pointer;
transition: border-radius 0s ease 0s;
.dark-theme & {
background: $dark-background-secondary;
}
}
&__title {
flex: 1;
color: $light-color;
padding: 3px 10px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
font-weight: 600;
.dark-theme & {
color: $dark-color;
}
}
&__badge {
background: $light-background;
color: $light-color;
border-radius: 10px;
padding: 3px 10px;
font-weight: 600;
.dark-theme & {
background: $dark-background;
color: $dark-color;
}
}
&__toggle {
color: $light-color;
font-size: 16px;
padding: 3px 10px;
font-weight: 700;
&:after {
content: attr(data-label-collapse);
}
.dark-theme & {
color: $dark-color;
}
}
pre {
margin-top: 0;
margin-bottom: 0;
border-radius: 0;
}
}