ant-design/components/collapse/style/index.less

130 lines
2.7 KiB
Plaintext
Raw Normal View History

@import "../../style/themes/default";
@import "../../style/mixins/index";
@collapse-prefix-cls: ~"@{ant-prefix}-collapse";
@collapse-header-bg: @background-color-base;
@collapse-active-bg: @background-color-active;
2015-11-26 19:32:55 +08:00
.collapse-close() {
.iconfont-size-under-12px(9px, 0);
2015-11-26 19:32:55 +08:00
}
.collapse-open() {
.iconfont-size-under-12px(9px, 90deg);
2015-07-11 10:17:58 +08:00
}
2015-08-20 16:55:42 +08:00
.@{collapse-prefix-cls} {
background-color: @collapse-header-bg;
border-radius: @border-radius-base;
border: @border-width-base @border-style-base @border-color-base;
border-bottom: 0;
2015-07-11 10:17:58 +08:00
2015-07-14 21:09:16 +08:00
& > &-item {
border-bottom: @border-width-base @border-style-base @border-color-base;
2017-07-27 17:16:01 +08:00
&:last-child {
&,
& > .@{collapse-prefix-cls}-header {
border-radius: 0 0 @border-radius-base @border-radius-base;
}
}
2015-08-20 16:55:42 +08:00
> .@{collapse-prefix-cls}-header {
line-height: 22px;
padding: 8px 0 8px 32px;
2017-03-07 14:29:02 +08:00
color: @heading-color;
cursor: pointer;
position: relative;
transition: all .3s;
.arrow {
2015-11-26 19:32:55 +08:00
.collapse-close();
.iconfont-mixin();
position: absolute;
color: @text-color-secondary;
2015-07-14 21:09:16 +08:00
display: inline-block;
font-weight: bold;
line-height: 40px;
2017-09-15 09:55:00 +08:00
vertical-align: top;
transition: transform 0.24s;
2015-11-04 17:54:51 +08:00
top: 0;
left: 16px;
&:before {
content: "\E61F";
}
2015-07-14 21:09:16 +08:00
}
}
}
&-anim-active {
transition: height .2s @ease-out;
}
2015-07-11 10:17:58 +08:00
&-content {
overflow: hidden;
2015-07-21 15:17:42 +08:00
color: @text-color;
2015-07-11 10:17:58 +08:00
padding: 0 16px;
background-color: @component-background;
2015-07-14 21:09:16 +08:00
& > &-box {
2015-08-20 15:39:36 +08:00
padding-top: 16px;
padding-bottom: 16px;
2015-07-11 10:17:58 +08:00
}
2015-08-31 16:58:27 +08:00
2016-03-30 16:27:14 +08:00
&-inactive {
display: none;
2015-08-31 16:58:27 +08:00
}
2015-07-11 10:17:58 +08:00
}
2015-07-14 21:09:16 +08:00
&-item:last-child {
2015-08-20 16:55:42 +08:00
> .@{collapse-prefix-cls}-content {
border-radius: 0 0 @border-radius-base @border-radius-base;
2015-07-14 21:09:16 +08:00
}
2015-07-11 10:17:58 +08:00
}
2015-11-04 17:54:51 +08:00
& > &-item > &-header[aria-expanded="true"] {
.arrow {
2015-11-26 19:32:55 +08:00
.collapse-open();
2015-07-11 10:17:58 +08:00
}
}
&-borderless {
background-color: @component-background;
border: 0;
}
2017-09-03 18:24:22 +08:00
&-borderless > &-item:last-child,
&-borderless > &-item:last-child &-header {
border-radius: 0;
}
&-borderless > &-item-active {
border: 0;
}
&-borderless > &-item > &-content {
background-color: transparent;
border-top: @border-width-base @border-style-base @border-color-base;
}
&-borderless > &-item > &-header {
transition: all .3s;
&:hover {
background-color: @collapse-header-bg;
}
}
& &-item-disabled > &-header {
&,
& > .arrow {
cursor: not-allowed;
color: @disabled-color;
background-color: @disabled-bg;
}
}
2017-06-26 20:58:03 +08:00
2017-07-27 17:16:01 +08:00
& > &-item:not(&-item-disabled) > .@{collapse-prefix-cls}-header:active {
2017-06-26 20:58:03 +08:00
background-color: @collapse-active-bg;
}
2015-07-11 10:17:58 +08:00
}