Blame view

src/styles/components/carousel.less 3.07 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;
65c64ce9   Rijn   carousel basic po...
34
35
36
37
38
39
      }
  
      &-item {
          float: left;
          height: 100%;
          min-height: 1px;
3e6d6356   Rijn   implement basic t...
40
          display: block;
65c64ce9   Rijn   carousel basic po...
41
      }
90f77e40   Rijn   updated carousel ...
42
43
  
      &-arrow {
e9989f2b   Rijn   added horizontal ...
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
  
          border: none;
          outline: none;
  
          padding: 0;
          margin: 0;
  
          width: 36px;
          height: 36px;
          border-radius: 50%;
  
          cursor: pointer;
  
          display: none;
  
90f77e40   Rijn   updated carousel ...
59
          position: absolute;
e9989f2b   Rijn   added horizontal ...
60
61
62
63
          top: 50%;
          z-index: 10;
          transform: translateY(-50%);
  
5139233b   梁灏   update Carousel
64
          transition: @transition-time;
e9989f2b   Rijn   added horizontal ...
65
66
67
68
69
70
          background-color: rgba(31, 45, 61, .11);
          color: #fff;
  
          &:hover {
              background-color: rgba(31, 45, 61, 0.5);
          }
90f77e40   Rijn   updated carousel ...
71
72
  
          text-align: center;
e9989f2b   Rijn   added horizontal ...
73
74
75
76
          font-size: 1em;
  
          font-family: inherit;
          line-height: inherit;
90f77e40   Rijn   updated carousel ...
77
78
  
          & > * {
e9989f2b   Rijn   added horizontal ...
79
              vertical-align: baseline;
90f77e40   Rijn   updated carousel ...
80
81
          }
  
e9989f2b   Rijn   added horizontal ...
82
83
          &.left {
              left: 16px;
90f77e40   Rijn   updated carousel ...
84
85
          }
  
e9989f2b   Rijn   added horizontal ...
86
87
88
          &.right {
              right: 16px;
          }
90f77e40   Rijn   updated carousel ...
89
  
e9989f2b   Rijn   added horizontal ...
90
91
          &-always {
              display: inherit;
90f77e40   Rijn   updated carousel ...
92
          }
e9989f2b   Rijn   added horizontal ...
93
94
95
96
97
  
          &-hover {
              display: inherit;
  
              opacity: 0;
90f77e40   Rijn   updated carousel ...
98
          }
e9989f2b   Rijn   added horizontal ...
99
      }
90f77e40   Rijn   updated carousel ...
100
  
e9989f2b   Rijn   added horizontal ...
101
102
103
      &:hover &-arrow-hover {
          opacity: 1;
      }
90f77e40   Rijn   updated carousel ...
104
  
e9989f2b   Rijn   added horizontal ...
105
      &-dots {
9cd69375   Rijn   added height props
106
107
          z-index: 10;
  
e9989f2b   Rijn   added horizontal ...
108
          @padding: 7px;
90f77e40   Rijn   updated carousel ...
109
  
9cd69375   Rijn   added height props
110
111
          display: none;
  
8738f4d3   Rijn   added outside dots
112
113
          position: relative;
          &-inside {
9cd69375   Rijn   added height props
114
              display: block;
8738f4d3   Rijn   added outside dots
115
116
117
118
119
              position: absolute;
              bottom: 10px - @padding;
          }
  
          &-outside {
9cd69375   Rijn   added height props
120
              display: block;
8738f4d3   Rijn   added outside dots
121
122
              margin-top: 10px - @padding;
          }
e9989f2b   Rijn   added horizontal ...
123
  
8738f4d3   Rijn   added outside dots
124
          list-style: none;
e9989f2b   Rijn   added horizontal ...
125
126
127
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
  
          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 ...
161
162
163
164
165
166
167
168
169
170
171
                  transition: all .5s;
              }
  
              &:hover > button {
                  opacity: 0.7;
              }
  
              &.@{carousel-prefix-cls}-active > button {
                  opacity: 1;
                  width: 24px;
              }
90f77e40   Rijn   updated carousel ...
172
173
          }
      }
6c9acb08   Rijn   initialize carousel
174
  }