-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] v5: Carousel improvements for easier customization #28266
Conversation
19de417
to
072a0e0
Compare
303c42c
to
05a439c
Compare
…nge text, control, and indicator colors
Cleaned some of this up for the new example I added many months ago. Any additional ideas for what to improve here for v5 @twbs/css-review? |
display: block; | ||
height: $carousel-indicator-hit-area-height * 3; | ||
content: ""; | ||
background-color: rgba(255, 0, 0, .1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why red? 😃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this shadow needs to be applied to the element itself
} | ||
.carousel-control-prev-icon { | ||
background-image: escape-svg($carousel-control-prev-icon-bg); | ||
// background-image: escape-svg($carousel-control-prev-icon-bg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The controls are gone now?
@@ -158,21 +161,35 @@ | |||
list-style: none; | |||
|
|||
li { | |||
box-sizing: content-box; | |||
position: relative; | |||
// box-sizing: content-box; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove these comments?
bottom: -$carousel-indicator-hit-area-height; | ||
left: -$carousel-indicator-hit-area-height / 2; | ||
display: block; | ||
height: $carousel-indicator-hit-area-height * 3; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Height is redundant since we already set top and bottom
$carousel-indicator-transition: opacity .6s ease !default; | ||
|
||
$carousel-caption-width: 70% !default; | ||
$carousel-caption-color: $white !default; | ||
$carousel-caption-color: inherit !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use null
here?
border-top: $carousel-indicator-hit-area-height solid transparent; | ||
border-bottom: $carousel-indicator-hit-area-height solid transparent; | ||
// border-top: $carousel-indicator-hit-area-height solid transparent; | ||
// border-bottom: $carousel-indicator-hit-area-height solid transparent; | ||
opacity: .5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably interesting to make this a variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would close #29332
@@ -158,21 +161,35 @@ | |||
list-style: none; | |||
|
|||
li { | |||
box-sizing: content-box; | |||
position: relative; | |||
// box-sizing: content-box; | |||
flex: 0 1 auto; | |||
width: $carousel-indicator-width; | |||
height: $carousel-indicator-height; | |||
margin-right: $carousel-indicator-spacer; | |||
margin-left: $carousel-indicator-spacer; | |||
text-indent: -999px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this? No text is added in the thumbnails anyway. If it needs text, we can work with aria-labels
?
$carousel-control-color: $white !default; | ||
$carousel-color: $white !default; | ||
|
||
$carousel-control-color: inherit !default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use null
here?
@@ -13,6 +13,7 @@ | |||
|
|||
.carousel { | |||
position: relative; | |||
color: $carousel-color; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this. Maybe we can also add an example with light slides with a .text-dark
added to the carousel?
</div> | ||
</div> | ||
</div> | ||
<a class="carousel-control-prev" href="#carouselExampleColors" role="button" data-slide="prev"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<a role="button">
, looks nasty. Can we just use <button>
s here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how the carousel works today, so this isn't any kind of regression. I'm down to use buttons here, but I'd need help to rewrite the JS that attaches these anchors to the appropriate carousel.
Closing as stale. |
WIP, do not merge.
This PR starts some work to revamp the carousel to use
currentColor
, allowing us to better use utilities to change text, control, and indicator colors. Can't recall where I left this off previously, so need to dig back in before I get a checklist of todos going. At the very least I'll need to consider some migration docs.