collapse.less 1.5 KB
Newer Older
翰文 已提交
1
@prefixCls: ant-collapse;
翰文 已提交
2
@borderStyle: 1px solid #d9d9d9;
翰文 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

#arrow {
  .common(){
    width: 0;
    height: 0;
    font-size: 0;
    line-height: 0;
  }
  .right(@w, @h, @color) {
    border-top: @w solid transparent;
    border-bottom: @w solid transparent;
    border-left: @h solid @color;
  }

  .bottom(@w, @h, @color) {
    border-left: @w solid transparent;
    border-right: @w solid transparent;
    border-top: @h solid @color;
  }
}

.@{prefixCls} {
翰文 已提交
25
  background-color: #f4f4f4;
翰文 已提交
26
  border-radius: 3px;
翰文 已提交
27
  border: @borderStyle;
翰文 已提交
28

29
  & > &-item {
翰文 已提交
30 31 32 33 34
    border-top: @borderStyle;
    &:first-child {
      border-top: none;
    }

35 36 37 38
    > .@{prefixCls}-header {
      height: 38px;
      line-height: 38px;
      text-indent: 16px;
A
afc163 已提交
39
      color: #666;
40 41 42 43 44 45 46 47 48 49 50
      &:before {
        display: inline-block;
        content: '\20';
        #arrow > .common();
        #arrow > .right(3px, 4px, #666);
        vertical-align: middle;
        margin-right: 8px;
      }
    }
  }

翰文 已提交
51 52
  &-content {
    height: 0;
53
    transition-duration: .3s;
A
afc163 已提交
54
    transition-timing-function: @ease-out;
翰文 已提交
55
    overflow: hidden;
A
afc163 已提交
56
    color: @text-color;
翰文 已提交
57
    padding: 0 16px;
翰文 已提交
58
    background-color: #fff;
59 60 61 62

    & > &-box {
      margin-top: 16px;
      margin-bottom: 16px;
翰文 已提交
63 64 65
    }
  }

66 67 68 69
  &-item:last-child {
    > .@{prefixCls}-content {
      border-radius: 0 0 3px 3px;
    }
翰文 已提交
70 71
  }

72
  &-content-active {
翰文 已提交
73 74
  }

75 76 77 78 79 80 81
  & > &-item-active {
    > .@{prefixCls}-header {

      &:before {
        #arrow > .bottom(3px, 4px, #666);
        margin-right: 6px;
      }
翰文 已提交
82 83 84
    }
  }
}
85