Skip to content

Commit 81e3ca2

Browse files
committed
refactor: rebuild .carousel-dark using CSS Variables
1 parent 10a9839 commit 81e3ca2

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

scss/_carousel.scss

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@
9898
align-items: center; // 2. vertically center contents
9999
justify-content: center; // 3. horizontally center contents
100100
width: $carousel-control-width;
101-
color: $carousel-control-color;
101+
color: var(--#{$variable-prefix}carousel-control-color, $carousel-control-color);
102102
text-align: center;
103103
opacity: $carousel-control-opacity;
104104
@include transition($carousel-control-transition);
105105

106106
// Hover/focus state
107107
&:hover,
108108
&:focus {
109-
color: $carousel-control-color;
109+
color: var(--#{$variable-prefix}carousel-control-color, $carousel-control-color);
110110
text-decoration: none;
111111
outline: 0;
112112
opacity: $carousel-control-hover-opacity;
@@ -175,7 +175,7 @@
175175
margin-left: $carousel-indicator-spacer;
176176
text-indent: -999px;
177177
cursor: pointer;
178-
background-color: $carousel-indicator-active-bg;
178+
background-color: var(--#{$variable-prefix}carousel-indicator-active-bg, $carousel-indicator-active-bg);
179179
background-clip: padding-box;
180180
// Use transparent borders to increase the hit area by 10px on top and bottom.
181181
border-top: $carousel-indicator-hit-area-height solid transparent;
@@ -201,23 +201,17 @@
201201
left: (100% - $carousel-caption-width) / 2;
202202
padding-top: $carousel-caption-padding-y;
203203
padding-bottom: $carousel-caption-padding-y;
204-
color: $carousel-caption-color;
204+
color: var(--#{$variable-prefix}carousel-caption-color, $carousel-caption-color);
205205
text-align: center;
206206
}
207207

208208
// Dark mode carousel
209209

210210
.carousel-dark {
211+
--#{$variable-prefix}carousel-indicator-active-bg: #{$carousel-dark-indicator-active-bg};
212+
--#{$variable-prefix}carousel-caption-color: #{$carousel-dark-caption-color};
211213
.carousel-control-prev-icon,
212214
.carousel-control-next-icon {
213215
filter: $carousel-dark-control-icon-filter;
214216
}
215-
216-
.carousel-indicators li {
217-
background-color: $carousel-dark-indicator-active-bg;
218-
}
219-
220-
.carousel-caption {
221-
color: $carousel-dark-caption-color;
222-
}
223217
}

0 commit comments

Comments
 (0)