collapse.less 1.4 KB
Newer Older
翰文 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
@prefixCls: ant-collapse;
@borderStyle: 1px solid #d9d9d9;

#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} {
  background-color: #f3f5f7;
  border-radius: 3px;
  border-top: @borderStyle;
  border-left: @borderStyle;
  border-right: @borderStyle;

  &-content {
    height: 0;
    opacity: 0;
    transition-property: all;
35
    transition-duration: .2s;
翰文 已提交
36 37 38 39 40
    transition-timing-function: ease-in;
    overflow: hidden;
    color: #999;
    padding: 0 16px;
    background-color: #fbfbfb;
41
    > p, > div {
翰文 已提交
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
      margin-top: 10px;
      margin-bottom: 10px;
    }
  }

  &-content-active {
    opacity: 1;
    height: auto;
    border-bottom: @borderStyle;
  }

  &-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;
    }
  }

  &-item-active {
    .@{prefixCls}-header::before {
      #arrow > .bottom(3px, 4px, #666);
    }
  }
}