amis2/scss/components/_collapse.scss

76 lines
1.5 KiB
SCSS
Raw Normal View History

2019-04-30 11:11:25 +08:00
.#{$ns}Collapse {
2020-06-14 11:17:22 +08:00
border: none;
2019-12-06 09:58:08 +08:00
padding: 0;
margin-bottom: var(--Form-item-gap);
2019-04-30 11:11:25 +08:00
2019-12-06 09:58:08 +08:00
&-header {
font-size: var(--fontSizeMd);
font-weight: var(--fontWeightNormal);
color: var(--text--loud-color);
padding: var(--gap-xs) 0;
border-bottom: var(--borderWidth) solid var(--borderColorLight);
2019-12-06 09:58:08 +08:00
}
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: var(--gap-xs);
2019-12-06 09:58:08 +08:00
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: var(--text-color);
2019-12-06 09:58:08 +08:00
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 {
cursor: pointer;
2019-12-06 09:58:08 +08:00
user-select: none;
}
// title 显示在底部的模式
&--title-bottom &-header {
text-align: center;
color: var(--link-color);
border-left: none;
font-size: var(--fontSizeBase);
}
&--title-bottom &-arrow:before {
top: px2rem(2px);
transform: rotate(-45deg);
transform-origin: 0% 50%;
}
&--title-bottom.is-collapsed &-arrow:before {
top: px2rem(-6px);
transform: rotate(135deg);
transform-origin: 0% 50%;
}
2019-12-06 09:58:08 +08:00
&-content {
transition: height var(--animation-duration) ease;
2020-06-14 11:17:22 +08:00
2019-12-06 09:58:08 +08:00
&.in,
&.out {
height: 0;
overflow: hidden;
}
2019-12-06 09:58:08 +08:00
}
}