tabs.less 4.6 KB
Newer Older
A
afc163 已提交
1
@prefixClass: ant-tabs;
Y
yiminghe 已提交
2

Y
Yuwei Ba 已提交
3 4
@easing-in-out: cubic-bezier(0.35, 0, 0.25, 1);

Y
yiminghe 已提交
5
@effect-duration: .3s;
Y
Yuwei Ba 已提交
6 7 8 9 10 11 12 13 14 15

.@{prefixClass} {
  outline: none;
  box-sizing: border-box;
  position: relative;

  &-ink-bar {
    z-index: 1;
    position: absolute;
    left: 0;
Y
yiminghe 已提交
16
    bottom: 0;
Y
Yuwei Ba 已提交
17
    box-sizing: border-box;
A
afc163 已提交
18
    height: 2px;
Y
Yuwei Ba 已提交
19 20 21
    background-color: #3fc7fa;
    transform: scaleX(1);
    transform-origin: 0 0;
Y
yiminghe 已提交
22
    &-transition-forward {
Y
Yuwei Ba 已提交
23 24 25
      transition: right 0.3s @easing-in-out,
      left 0.3s @easing-in-out 0.3s * 0.3;
    }
Y
yiminghe 已提交
26
    &-transition-backward {
Y
Yuwei Ba 已提交
27 28 29 30 31 32 33
      transition: right 0.3s @easing-in-out 0.3s * 0.3,
      left 0.3s @easing-in-out;
    }
  }

  &-nav-container {
    font-size: 14px;
A
afc163 已提交
34
    line-height: @line-height-base;
Y
Yuwei Ba 已提交
35 36 37 38 39
    box-sizing: border-box;
    width: 100%;
    position: relative;
    white-space: nowrap;
    padding-right: 32px;
A
afc163 已提交
40 41 42
    border-bottom: 1px solid #f3f3f3;
    margin-bottom: 15px;
    .clearfix;
Y
Yuwei Ba 已提交
43 44 45 46 47
  }

  &-tab-prev, &-tab-next {
    user-select: none;
    -webkit-user-select: none;
A
afc163 已提交
48
    z-index: 2;
Y
Yuwei Ba 已提交
49
    margin-right: -2px;
A
afc163 已提交
50
    margin-top: 1px;
Y
Yuwei Ba 已提交
51 52
    width: 32px;
    height: 100%;
A
afc163 已提交
53
    line-height: 32px;
Y
Yuwei Ba 已提交
54 55 56 57
    cursor: pointer;
    border: none;
    background-color: transparent;
    position: absolute;
A
afc163 已提交
58
    text-align: center;
Y
Yuwei Ba 已提交
59 60 61 62 63

    &-icon {
      position: relative;
      display: inline-block;
      font-style: normal;
A
afc163 已提交
64
      font-weight: bold;
Y
Yuwei Ba 已提交
65 66 67 68 69 70 71 72 73
      font-variant: normal;
      line-height: inherit;
      vertical-align: baseline;
      text-align: center;
      text-transform: none;
      font-family: sans-serif;

      &:before {
        display: block;
A
afc163 已提交
74
        font-family: "anticon" !important;
Y
Yuwei Ba 已提交
75 76
      }
    }
A
afc163 已提交
77 78 79 80

    &:hover {
      color: fadeout(#2db7f5, 20%);
    }
Y
Yuwei Ba 已提交
81 82 83 84 85 86
  }

  &-tab-next {
    right: 2px;

    &-icon:before {
A
afc163 已提交
87
      content: "\e611";
Y
Yuwei Ba 已提交
88 89 90 91 92
    }
  }

  &-tab-prev {
    left: 0;
A
afc163 已提交
93
    background: #fff;
Y
Yuwei Ba 已提交
94 95 96
    transform: rotate(180deg);
    filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=2);
    &-icon:before {
A
afc163 已提交
97
      content: "\e611";
Y
Yuwei Ba 已提交
98 99 100 101 102 103
    }
  }

  &-nav-wrap {
    width: 100%;
    overflow: hidden;
Y
Yuwei Ba 已提交
104
    margin-bottom: -1px;
Y
Yuwei Ba 已提交
105 106 107
  }

  &-nav-scroll {
A
afc163 已提交
108 109
    width: 99999px;
    overflow: hidden;
Y
Yuwei Ba 已提交
110 111 112 113 114 115 116 117 118
  }

  &-nav {
    box-sizing: border-box;
    padding-left: 0;
    transition: left 0.5s @easing-in-out;
    position: relative;
    margin: 0;
    list-style: none;
A
afc163 已提交
119
    float: left;
Y
Yuwei Ba 已提交
120 121 122 123 124 125 126 127 128 129 130 131

    &:before, &:after {
      display: table;
      content: " ";
    }

    &:after {
      clear: both;
    }

    div.@{prefixClass}-tab-active {
      > a, > a:hover, > a:focus {
A
afc163 已提交
132
        color: fadeout(#2db7f5, 20%);
A
afc163 已提交
133
        cursor: pointer;
Y
Yuwei Ba 已提交
134 135 136 137 138 139 140
        text-decoration: none;
      }
    }

    div.@{prefixClass}-tab-disabled {
      pointer-events: none;
      cursor: default;
Y
Yuwei Ba 已提交
141 142 143 144

      a {
        color: #ccc;
      }
Y
Yuwei Ba 已提交
145 146 147 148 149
    }

    .@{prefixClass}-tab {
      float: left;
      height: 100%;
A
afc163 已提交
150
      margin-right: 28px;
Y
Yuwei Ba 已提交
151 152 153 154
      box-sizing: border-box;
      position: relative;

      > a {
A
afc163 已提交
155
        padding: 8px 20px;
Y
Yuwei Ba 已提交
156
        transition: color 0.3s @easing-in-out;
A
afc163 已提交
157
        display: block;
Y
Yuwei Ba 已提交
158
        color: #666;
Y
Yuwei Ba 已提交
159 160 161 162

        .anticon {
          width: 14px;
          height: 14px;
A
afc163 已提交
163
          margin-right: 8px;
Y
Yuwei Ba 已提交
164 165 166
          top: -1px;
        }

Y
Yuwei Ba 已提交
167 168 169
      }

      > a:hover {
A
afc163 已提交
170
        color: fadeout(#2db7f5, 30%);
Y
Yuwei Ba 已提交
171 172 173 174 175 176 177 178 179
        cursor: pointer;
      }

      > a:hover, > a:focus {
        text-decoration: none;
      }
    }
  }

A
afc163 已提交
180 181 182 183 184 185 186 187
  &-mini &-nav-container {
    font-size: 12px;
  }

  &-mini &-tab {
    margin-right: 20px;
  }

Y
Yuwei Ba 已提交
188 189 190 191 192 193 194 195 196
  &-tabpane-hidden {
    display: none;
  }

  &-content {
    position: relative;
    width: 100%;
  }

Y
yiminghe 已提交
197
  &-slide-horizontal-backward-enter {
Y
Yuwei Ba 已提交
198 199 200
    transform: translateX(-100%);
  }

Y
yiminghe 已提交
201
  &-slide-horizontal-backward-enter&-slide-horizontal-backward-enter-active {
Y
Yuwei Ba 已提交
202 203 204 205
    transform: translateX(0);
    transition: transform @effect-duration @easing-in-out;
  }

Y
yiminghe 已提交
206
  &-slide-horizontal-backward-leave {
Y
Yuwei Ba 已提交
207 208 209 210 211 212 213 214
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateX(0);
  }

Y
yiminghe 已提交
215
  &-slide-horizontal-backward-leave&-slide-horizontal-backward-leave-active {
Y
Yuwei Ba 已提交
216 217 218 219
    transform: translateX(100%);
    transition: transform @effect-duration @easing-in-out;
  }

Y
yiminghe 已提交
220
  &-slide-horizontal-forward-enter {
Y
Yuwei Ba 已提交
221 222 223
    transform: translateX(100%);
  }

Y
yiminghe 已提交
224
  &-slide-horizontal-forward-enter&-slide-horizontal-forward-enter-active {
Y
Yuwei Ba 已提交
225 226 227 228
    transform: translateX(0);
    transition: transform @effect-duration @easing-in-out;
  }

Y
yiminghe 已提交
229
  &-slide-horizontal-forward-leave {
Y
Yuwei Ba 已提交
230 231 232 233 234 235 236 237
    position: absolute;
    transform: translateX(0);
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
  }

Y
yiminghe 已提交
238
  &-slide-horizontal-forward-leave&-slide-horizontal-forward-leave-active {
Y
Yuwei Ba 已提交
239 240 241
    transform: translateX(-100%);
    transition: transform @effect-duration @easing-in-out;
  }
A
afc163 已提交
242
}