amis2/scss/components/_collapse.scss

53 lines
1.0 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}Collapse {
2019-12-06 09:58:08 +08:00
padding: 0;
margin-bottom: $Form-item-gap;
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-header {
font-size: $fontSizeMd;
font-weight: $fontWeightNormal;
color: $text--loud-color;
padding: px2rem(5px) 0;
border-bottom: $borderWidth solid lighten($borderColor, 5%);
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-arrow {
display: inline-block;
width: px2rem(16px);
text-align: center;
margin-left: $gap-xs;
cursor: pointer;
2019-12-06 09:58:08 +08:00
&:before {
content: '';
position: relative;
display: inline-block;
width: px2rem(6px);
height: px2rem(6px);
top: px2rem(-4px);
border-color: $text-color;
border-style: solid;
border-width: px2rem(1px) px2rem(1px) 0 0;
transform: rotate(135deg);
transform-origin: 50% 50%;
2019-04-30 11:11:25 +08:00
}
2019-12-06 09:58:08 +08:00
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&.is-collapsed &-arrow:before {
transform: rotate(45deg);
transform-origin: 0% 50%;
}
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&--collapsable &-header {
user-select: none;
}
2019-12-06 09:58:08 +08:00
&-content {
transition: height 0.35s ease;
&.in,
&.out {
height: 0;
overflow: hidden;
}
2019-12-06 09:58:08 +08:00
}
}