Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

mdo
Copy link
Member

@mdo mdo commented Feb 14, 2019

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.

@mdo mdo requested a review from a team as a code owner February 14, 2019 17:56
@XhmikosR XhmikosR changed the title v5: Carousel improvements for easier customization [WIP] v5: Carousel improvements for easier customization Feb 14, 2019
@mdo mdo mentioned this pull request Mar 13, 2019
13 tasks
@XhmikosR XhmikosR force-pushed the v5-carousel branch 2 times, most recently from 303c42c to 05a439c Compare March 13, 2019 23:45
@mdo
Copy link
Member Author

mdo commented Aug 30, 2019

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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why red? 😃

Copy link
Member

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);
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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

Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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;
Copy link
Member

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">
Copy link
Member

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?

Copy link
Member Author

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.

@mdo mdo changed the base branch from master to main June 16, 2020 20:17
@mdo
Copy link
Member Author

mdo commented Sep 16, 2020

Closing as stale.

@mdo mdo closed this Sep 16, 2020
@mdo mdo deleted the v5-carousel branch September 16, 2020 05:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants