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

There is an unecessary list-type on the .carousel-indicators element #37769

Closed
CyrilKrylatov opened this issue Dec 30, 2022 · 5 comments · Fixed by #37956
Closed

There is an unecessary list-type on the .carousel-indicators element #37769

CyrilKrylatov opened this issue Dec 30, 2022 · 5 comments · Fixed by #37956
Labels

Comments

@CyrilKrylatov
Copy link

Right here:

list-style: none;

I think it could be removed as in the documentation Bootstrap is using a div element, not an ul.

If you think it's worth the shot, I could make a PR about it.

Should I make it?

One of my 2023 goal is to be more involved in Bootstrap, so it could be a good very first exercice for me!

✌️

@julien-deramond
Copy link
Member

julien-deramond commented Dec 31, 2022

I did some archeology and when this line was introduced, carousel indicators in the documentation were created like this:

<ol class="carousel-indicators">
  <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
  <li data-target="#myCarousel" data-slide-to="1"></li>
  <li data-target="#myCarousel" data-slide-to="2"></li>
</ol>

We can still find it in https://getbootstrap.com/docs/4.6/components/carousel/.
I don't have the history but I suppose taht we let that either because we forgot 😇 or to help with the migration from v4 to v5.

In v5, we don't provide anymore a carousel indicators example with <ol> + <li>s but with <div> + <button>s. It's not mentioned in the docs that it could be done with lists.
So I'm not against dropping list-style: none; and changing the corresponding comment in the Sass file.
Thoughts @twbs/css-review? Any strong opinion to keep this style?

@mdo
Copy link
Member

mdo commented Jan 4, 2023

Can probably be removed—we dropped it in #32661 (v5 beta 2) and then backported it to v4.x.

@mdo
Copy link
Member

mdo commented Jan 4, 2023

@CyrilKrylatov I'd say go for it!

@CyrilKrylatov
Copy link
Author

@CyrilKrylatov I'd say go for it!

Yay! I'll do it within the week; can't wait to open my very first PR on Bootstrap!

@jeff-at-livecanvas
Copy link

IMHO using ol / li or ul / li tags looked a bit better, code-wise, at least at first sight.
But I can see why, semantically, it's not a big difference. Indicators bring little meaning inside the tag.
Buttons totally make sense.

From a practical POV:
This change broke some old templates in our world - but no big issue. You will see a number close to the carousel indicator.

In case somebody finds it useful, you can fix things in old carousels by adding the list-unstyled class to the ol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants