papercss/src/components/_accordion.scss

50 lines
862 B
SCSS
Raw Normal View History

2017-12-27 17:39:45 +01:00
.collapsible {
2017-12-30 13:07:53 +01:00
display: flex;
flex-direction: column;
2017-12-27 17:39:45 +01:00
2017-12-30 13:07:53 +01:00
&:nth-of-type(1) {
border-top: 1px solid $muted-light;
}
2017-12-27 17:39:45 +01:00
2017-12-30 13:07:53 +01:00
.collapsible-body {
2018-05-24 14:13:53 +02:00
@include transition;
2017-12-30 13:07:53 +01:00
background-color: lighten($white-dark, 80%);
border-bottom: 1px solid $muted-light;
2018-05-24 14:13:53 +02:00
margin: 0;
max-height: 0;
opacity: 0;
overflow: hidden;
padding: 0 0.75rem;
2017-12-30 13:07:53 +01:00
}
2017-12-27 17:39:45 +01:00
2017-12-30 13:07:53 +01:00
input {
display: none;
2017-12-27 17:39:45 +01:00
2017-12-30 13:07:53 +01:00
&:checked + label {
color: $primary;
2017-12-27 17:39:45 +01:00
}
2017-12-30 13:07:53 +01:00
2018-05-24 14:13:53 +02:00
&[id^='collapsible']:checked~div.collapsible-body {
2017-12-30 13:07:53 +01:00
margin: 0;
2018-05-24 14:13:53 +02:00
max-height: 960px;
opacity: 1;
padding: 0.75rem;
2017-12-27 17:39:45 +01:00
}
2017-12-30 13:07:53 +01:00
}
label {
2018-05-24 14:13:53 +02:00
border-bottom: 1px solid $muted-light;
color: $primary;
2017-12-30 13:07:53 +01:00
display: inline-block;
font-weight: 600;
2018-05-24 14:13:53 +02:00
margin: 0 0 -1px;
padding: 0.75rem;
2017-12-30 13:07:53 +01:00
text-align: center;
&:hover {
color: $muted;
cursor: pointer;
2017-12-27 17:39:45 +01:00
}
2017-12-30 13:07:53 +01:00
}
2017-12-27 17:39:45 +01:00
}