Blame view

src/styles/components/carousel.less 3.34 KB
6c9acb08   Rijn   initialize carousel
1
2
3
4
  @carousel-prefix-cls: ~"@{css-prefix}carousel";
  @carousel-item-prefix-cls: ~"@{css-prefix}carousel-item";
  
  .@{carousel-prefix-cls} {
41f83010   Rijn   update props and ...
5
6
7
8
9
10
      position: relative;
      display: block;
      box-sizing: border-box;
      user-select: none;
      touch-action: pan-y;
      -webkit-tap-highlight-color: transparent;
65c64ce9   Rijn   carousel basic po...
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
  
      &-track, &-list {
          transform: translate3d(0, 0, 0);
      }
  
      &-list {
          position: relative;
          display: block;
          overflow: hidden;
  
          margin: 0;
          padding: 0;
      }
  
      &-track {
          position: relative;
          top: 0;
          left: 0;
          display: block;
3e6d6356   Rijn   implement basic t...
30
31
  
          overflow: hidden;
90f77e40   Rijn   updated carousel ...
32
33
  
          z-index: 1;
ccf544dc   houyl   Merge branch 'mas...
34
35
36
          &.higher {
              z-index: 2;
          }
65c64ce9   Rijn   carousel basic po...
37
38
39
40
41
42
      }
  
      &-item {
          float: left;
          height: 100%;
          min-height: 1px;
3e6d6356   Rijn   implement basic t...
43
          display: block;
65c64ce9   Rijn   carousel basic po...
44
      }
90f77e40   Rijn   updated carousel ...
45
46
  
      &-arrow {
e9989f2b   Rijn   added horizontal ...
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
  
          border: none;
          outline: none;
  
          padding: 0;
          margin: 0;
  
          width: 36px;
          height: 36px;
          border-radius: 50%;
  
          cursor: pointer;
  
          display: none;
  
90f77e40   Rijn   updated carousel ...
62
          position: absolute;
e9989f2b   Rijn   added horizontal ...
63
64
65
66
          top: 50%;
          z-index: 10;
          transform: translateY(-50%);
  
5139233b   梁灏   update Carousel
67
          transition: @transition-time;
e9989f2b   Rijn   added horizontal ...
68
69
70
71
72
73
          background-color: rgba(31, 45, 61, .11);
          color: #fff;
  
          &:hover {
              background-color: rgba(31, 45, 61, 0.5);
          }
90f77e40   Rijn   updated carousel ...
74
75
  
          text-align: center;
e9989f2b   Rijn   added horizontal ...
76
77
78
79
          font-size: 1em;
  
          font-family: inherit;
          line-height: inherit;
90f77e40   Rijn   updated carousel ...
80
81
  
          & > * {
e9989f2b   Rijn   added horizontal ...
82
              vertical-align: baseline;
90f77e40   Rijn   updated carousel ...
83
84
          }
  
e9989f2b   Rijn   added horizontal ...
85
86
          &.left {
              left: 16px;
90f77e40   Rijn   updated carousel ...
87
88
          }
  
e9989f2b   Rijn   added horizontal ...
89
90
91
          &.right {
              right: 16px;
          }
90f77e40   Rijn   updated carousel ...
92
  
e9989f2b   Rijn   added horizontal ...
93
94
          &-always {
              display: inherit;
90f77e40   Rijn   updated carousel ...
95
          }
e9989f2b   Rijn   added horizontal ...
96
97
98
99
100
  
          &-hover {
              display: inherit;
  
              opacity: 0;
90f77e40   Rijn   updated carousel ...
101
          }
e9989f2b   Rijn   added horizontal ...
102
      }
90f77e40   Rijn   updated carousel ...
103
  
e9989f2b   Rijn   added horizontal ...
104
105
106
      &:hover &-arrow-hover {
          opacity: 1;
      }
90f77e40   Rijn   updated carousel ...
107
  
e9989f2b   Rijn   added horizontal ...
108
      &-dots {
9cd69375   Rijn   added height props
109
110
          z-index: 10;
  
e9989f2b   Rijn   added horizontal ...
111
          @padding: 7px;
90f77e40   Rijn   updated carousel ...
112
  
9cd69375   Rijn   added height props
113
114
          display: none;
  
8738f4d3   Rijn   added outside dots
115
116
          position: relative;
          &-inside {
9cd69375   Rijn   added height props
117
              display: block;
8738f4d3   Rijn   added outside dots
118
119
120
121
122
              position: absolute;
              bottom: 10px - @padding;
          }
  
          &-outside {
9cd69375   Rijn   added height props
123
              display: block;
8738f4d3   Rijn   added outside dots
124
125
              margin-top: 10px - @padding;
          }
e9989f2b   Rijn   added horizontal ...
126
  
8738f4d3   Rijn   added outside dots
127
          list-style: none;
e9989f2b   Rijn   added horizontal ...
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
  
          text-align: center;
  
          padding: 0;
          width: 100%;
          height: 3px + @padding * 2;
  
          li {
              position: relative;
              display: inline-block;
  
              vertical-align: top;
              text-align: center;
  
              margin: 0 2px;
              padding: @padding 0;
  
              cursor: pointer;
  
              button {
                  border: 0;
                  cursor: pointer;
  
                  background: #8391a5;
                  opacity: 0.3;
  
                  display: block;
                  width: 16px;
                  height: 3px;
  
                  border-radius: 1px;
                  outline: none;
  
                  font-size: 0;
                  color: transparent;
  
e9989f2b   Rijn   added horizontal ...
164
                  transition: all .5s;
ccf544dc   houyl   Merge branch 'mas...
165
166
167
168
169
                  &.radius {
                      width: 6px;
                      height: 6px;
                      border-radius: 50%;
                  }
e9989f2b   Rijn   added horizontal ...
170
171
172
173
174
175
176
177
178
              }
  
              &:hover > button {
                  opacity: 0.7;
              }
  
              &.@{carousel-prefix-cls}-active > button {
                  opacity: 1;
                  width: 24px;
ccf544dc   houyl   Merge branch 'mas...
179
180
181
                  &.radius{
                      width: 6px;
                  }
e9989f2b   Rijn   added horizontal ...
182
              }
90f77e40   Rijn   updated carousel ...
183
184
          }
      }
6c9acb08   Rijn   initialize carousel
185
  }