| 1 |
efrain |
1 |
// Notes on the classes:
|
|
|
2 |
//
|
|
|
3 |
// 1. .carousel.pointer-event should ideally be pan-y (to allow for users to scroll vertically)
|
|
|
4 |
// even when their scroll action started on a carousel, but for compatibility (with Firefox)
|
|
|
5 |
// we're preventing all actions instead
|
|
|
6 |
// 2. The .carousel-item-left and .carousel-item-right is used to indicate where
|
|
|
7 |
// the active slide is heading.
|
|
|
8 |
// 3. .active.carousel-item is the current slide.
|
|
|
9 |
// 4. .active.carousel-item-left and .active.carousel-item-right is the current
|
|
|
10 |
// slide in its in-transition state. Only one of these occurs at a time.
|
|
|
11 |
// 5. .carousel-item-next.carousel-item-left and .carousel-item-prev.carousel-item-right
|
|
|
12 |
// is the upcoming slide in transition.
|
|
|
13 |
|
|
|
14 |
.carousel {
|
|
|
15 |
position: relative;
|
|
|
16 |
}
|
|
|
17 |
|
|
|
18 |
.carousel.pointer-event {
|
|
|
19 |
touch-action: pan-y;
|
|
|
20 |
}
|
|
|
21 |
|
|
|
22 |
.carousel-inner {
|
|
|
23 |
position: relative;
|
|
|
24 |
width: 100%;
|
|
|
25 |
overflow: hidden;
|
|
|
26 |
@include clearfix();
|
|
|
27 |
}
|
|
|
28 |
|
|
|
29 |
.carousel-item {
|
|
|
30 |
position: relative;
|
|
|
31 |
display: none;
|
|
|
32 |
float: left;
|
|
|
33 |
width: 100%;
|
|
|
34 |
margin-right: -100%;
|
|
|
35 |
backface-visibility: hidden;
|
|
|
36 |
@include transition($carousel-transition);
|
|
|
37 |
}
|
|
|
38 |
|
|
|
39 |
.carousel-item.active,
|
|
|
40 |
.carousel-item-next,
|
|
|
41 |
.carousel-item-prev {
|
|
|
42 |
display: block;
|
|
|
43 |
}
|
|
|
44 |
|
|
|
45 |
.carousel-item-next:not(.carousel-item-left),
|
|
|
46 |
.active.carousel-item-right {
|
|
|
47 |
transform: translateX(100%);
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
.carousel-item-prev:not(.carousel-item-right),
|
|
|
51 |
.active.carousel-item-left {
|
|
|
52 |
transform: translateX(-100%);
|
|
|
53 |
}
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
//
|
|
|
57 |
// Alternate transitions
|
|
|
58 |
//
|
|
|
59 |
|
|
|
60 |
.carousel-fade {
|
|
|
61 |
.carousel-item {
|
|
|
62 |
opacity: 0;
|
|
|
63 |
transition-property: opacity;
|
|
|
64 |
transform: none;
|
|
|
65 |
}
|
|
|
66 |
|
|
|
67 |
.carousel-item.active,
|
|
|
68 |
.carousel-item-next.carousel-item-left,
|
|
|
69 |
.carousel-item-prev.carousel-item-right {
|
|
|
70 |
z-index: 1;
|
|
|
71 |
opacity: 1;
|
|
|
72 |
}
|
|
|
73 |
|
|
|
74 |
.active.carousel-item-left,
|
|
|
75 |
.active.carousel-item-right {
|
|
|
76 |
z-index: 0;
|
|
|
77 |
opacity: 0;
|
|
|
78 |
@include transition(opacity 0s $carousel-transition-duration);
|
|
|
79 |
}
|
|
|
80 |
}
|
|
|
81 |
|
|
|
82 |
|
|
|
83 |
//
|
|
|
84 |
// Left/right controls for nav
|
|
|
85 |
//
|
|
|
86 |
|
|
|
87 |
.carousel-control-prev,
|
|
|
88 |
.carousel-control-next {
|
|
|
89 |
position: absolute;
|
|
|
90 |
top: 0;
|
|
|
91 |
bottom: 0;
|
|
|
92 |
z-index: 1;
|
|
|
93 |
// Use flex for alignment (1-3)
|
|
|
94 |
display: flex; // 1. allow flex styles
|
|
|
95 |
align-items: center; // 2. vertically center contents
|
|
|
96 |
justify-content: center; // 3. horizontally center contents
|
|
|
97 |
width: $carousel-control-width;
|
|
|
98 |
color: $carousel-control-color;
|
|
|
99 |
text-align: center;
|
|
|
100 |
opacity: $carousel-control-opacity;
|
|
|
101 |
@include transition($carousel-control-transition);
|
|
|
102 |
|
|
|
103 |
.theme-dark & {color: $dm-carousel-control-color;}
|
|
|
104 |
|
|
|
105 |
// Hover/focus state
|
|
|
106 |
@include hover-focus() {
|
|
|
107 |
color: $carousel-control-color;
|
|
|
108 |
text-decoration: none;
|
|
|
109 |
outline: 0;
|
|
|
110 |
opacity: $carousel-control-hover-opacity;
|
|
|
111 |
|
|
|
112 |
.theme-dark & {color: $dm-carousel-control-color;}
|
|
|
113 |
}
|
|
|
114 |
}
|
|
|
115 |
.carousel-control-prev {
|
|
|
116 |
left: 0;
|
|
|
117 |
@if $enable-gradients {
|
|
|
118 |
background-image: linear-gradient(90deg, rgba($black, .25), rgba($black, .001));
|
|
|
119 |
}
|
|
|
120 |
}
|
|
|
121 |
.carousel-control-next {
|
|
|
122 |
right: 0;
|
|
|
123 |
@if $enable-gradients {
|
|
|
124 |
background-image: linear-gradient(270deg, rgba($black, .25), rgba($black, .001));
|
|
|
125 |
}
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
// Icons for within
|
|
|
129 |
.carousel-control-prev-icon,
|
|
|
130 |
.carousel-control-next-icon {
|
|
|
131 |
display: inline-block;
|
|
|
132 |
width: $carousel-control-icon-width;
|
|
|
133 |
height: $carousel-control-icon-width;
|
|
|
134 |
background: 50% / 100% 100% no-repeat;
|
|
|
135 |
}
|
|
|
136 |
.carousel-control-prev-icon {
|
|
|
137 |
background-image: escape-svg($carousel-control-prev-icon-bg);
|
|
|
138 |
}
|
|
|
139 |
.carousel-control-next-icon {
|
|
|
140 |
background-image: escape-svg($carousel-control-next-icon-bg);
|
|
|
141 |
}
|
|
|
142 |
|
|
|
143 |
|
|
|
144 |
// Optional indicator pips
|
|
|
145 |
//
|
|
|
146 |
// Add an ordered list with the following class and add a list item for each
|
|
|
147 |
// slide your carousel holds.
|
|
|
148 |
|
|
|
149 |
.carousel-indicators {
|
|
|
150 |
position: absolute;
|
|
|
151 |
right: 0;
|
|
|
152 |
bottom: 0;
|
|
|
153 |
left: 0;
|
|
|
154 |
z-index: 15;
|
|
|
155 |
display: flex;
|
|
|
156 |
justify-content: center;
|
|
|
157 |
padding-left: 0; // override <ol> default
|
|
|
158 |
// Use the .carousel-control's width as margin so we don't overlay those
|
|
|
159 |
margin-right: $carousel-control-width;
|
|
|
160 |
margin-left: $carousel-control-width;
|
|
|
161 |
list-style: none;
|
|
|
162 |
|
|
|
163 |
li {
|
|
|
164 |
box-sizing: content-box;
|
|
|
165 |
flex: 0 1 auto;
|
|
|
166 |
width: $carousel-indicator-width;
|
|
|
167 |
height: $carousel-indicator-height;
|
|
|
168 |
margin-right: $carousel-indicator-spacer;
|
|
|
169 |
margin-left: $carousel-indicator-spacer;
|
|
|
170 |
text-indent: -999px;
|
|
|
171 |
cursor: pointer;
|
|
|
172 |
background-color: $carousel-indicator-active-bg;
|
|
|
173 |
background-clip: padding-box;
|
|
|
174 |
// Use transparent borders to increase the hit area by 10px on top and bottom.
|
|
|
175 |
border-top: $carousel-indicator-hit-area-height solid transparent;
|
|
|
176 |
border-bottom: $carousel-indicator-hit-area-height solid transparent;
|
|
|
177 |
opacity: .5;
|
|
|
178 |
@include transition($carousel-indicator-transition);
|
|
|
179 |
|
|
|
180 |
.theme-dark & {
|
|
|
181 |
background-color: $dm-carousel-indicator-active-bg;
|
|
|
182 |
}
|
|
|
183 |
}
|
|
|
184 |
|
|
|
185 |
.active {
|
|
|
186 |
opacity: 1;
|
|
|
187 |
}
|
|
|
188 |
}
|
|
|
189 |
|
|
|
190 |
|
|
|
191 |
// Optional captions
|
|
|
192 |
//
|
|
|
193 |
//
|
|
|
194 |
|
|
|
195 |
.carousel-caption {
|
|
|
196 |
position: absolute;
|
|
|
197 |
right: (100% - $carousel-caption-width) * 0.5;
|
|
|
198 |
bottom: 20px;
|
|
|
199 |
left: (100% - $carousel-caption-width) * 0.5;
|
|
|
200 |
z-index: 10;
|
|
|
201 |
padding-top: 20px;
|
|
|
202 |
padding-bottom: 20px;
|
|
|
203 |
color: $carousel-caption-color;
|
|
|
204 |
text-align: center;
|
|
|
205 |
|
|
|
206 |
.theme-dark & {color: $dm-carousel-caption-color;}
|
|
|
207 |
}
|