.collapsible-block { position: relative; width: 100%; margin: 30px 0; border-radius: 10px; overflow: hidden; &.tight { margin: 15px 0; } input[type="checkbox"] { position: absolute; visibility: hidden; } &__content { max-height: 80vh; overflow: auto; transition: max-height 0.15s ease; background-color: lighten($light-background-secondary, 5%); .dark-theme & { background-color: darken($dark-background-secondary, 6%); } &-child { transition: margin 0.15s ease; margin: 1em; .highlight { margin: 0 -1em; &:first-child { margin-top: -1em; } &:last-child { margin-bottom: -1em; } } } } input[type="checkbox"]:checked { ~ .collapsible-block__content { max-height: 0; overflow: hidden; } ~ 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; min-width: 30px; min-height: 30px; margin: 0; cursor: pointer; .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; } }