collapse.less 1.6 KB
Newer Older
翰文 已提交
1
@prefixCls: ant-collapse;
2
@borderStyle: 1px solid #e9e9e9;
翰文 已提交
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 27 28 29 30
  border-radius: 3px;
  border-top: @borderStyle;
  border-left: @borderStyle;
  border-right: @borderStyle;

31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
  & > &-item {
    > .@{prefixCls}-header {
      height: 38px;
      line-height: 38px;
      text-indent: 16px;
      color: #666;
      border-bottom: @borderStyle;
      &:before {
        display: inline-block;
        content: '\20';
        #arrow > .common();
        #arrow > .right(3px, 4px, #666);
        vertical-align: middle;
        margin-right: 8px;
      }
    }
  }

翰文 已提交
49 50
  &-content {
    height: 0;
51 52
    transition-duration: .3s;
    transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
翰文 已提交
53 54 55
    overflow: hidden;
    color: #999;
    padding: 0 16px;
翰文 已提交
56
    background-color: #fff;
57 58 59 60

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

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

70
  &-content-active {
翰文 已提交
71 72 73
    border-bottom: @borderStyle;
  }

74 75 76 77 78 79 80 81
  & > &-item-active {
    > .@{prefixCls}-header {
      border-bottom: none;

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