-
-
Notifications
You must be signed in to change notification settings - Fork 79k
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
Detach accordions from .card #22025
Comments
I'd be open to seeing this improved for v4 if we can muster it ahead of the next beta. It'd mean changing our JS and adding some additional styles, docs, examples, etc to do it right. At the very least we could add a second set of selectors there? In the mean time, I think you can change the selectors and classes in our JS to work for things other than the cards. /cc @bardiharborow and @Johann-S for ideas |
Maybe it's possible to get rid of Collapse's selectors by adding attributs.
And we will have a Collapse plugin more flexible than now. If you want @mdo or @bardiharborow I can make a draft |
I can dig that approach @Johann-S. Those attributes would be separate from the card CSS, but about the transitions/collapse CSS? https://github.com/twbs/bootstrap/blob/v4-dev/scss/_transitions.scss#L10-L35. Does anything need to change there, too? |
IMO nothing will change on those files but it's a bit hard to estimate without a draft. |
I dont' see how the CSS could be affected either. The collapse part (with transitions) works fine with my example in the original post. The only thing that needs rework is the |
This is my draft : http://codepen.io/Johann-S/pen/jBVNXr I kept the card selector ( EDIT : And my changes : https://github.com/Johann-S/bootstrap/commit/099486f294e79bfe1f2c6b431ee4696237f616cd <div id="accordion2" data-children=".itemAccordion">
<div class="itemAccordion">
<h3>
<a data-toggle="collapse" data-parent="#accordion2" href="#collapseOne2" aria-expanded="true" aria-controls="collapseOne2">
Item One
</a>
</h3>
<div id="collapseOne2" class="collapse show">
<ul class="list-unstyled">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</div>
</div>
<div class="itemAccordion">
<h3>
<a data-toggle="collapse" data-parent="#accordion2" href="#collapseTwo2" aria-expanded="false" aria-controls="collapseTwo2">
Item Two
</a>
</h3>
<div id="collapseTwo2" class="collapse">
<ul class="list-unstyled">
<li>Item</li>
<li>Item</li>
<li>Item</li>
<li>Item</li>
</ul>
</div>
</div>
</div> |
Nice! That's awesome. I'd love to see a PR for this :). Do we need any additional tests? I can provide on updates to the docs for examples and code snippets whenever you're ready :). |
I'll do it tomorrow 👍 and yes I'll add some unit tests And if you're motivated for doing the documentation it's ok for me 🤣 |
I'm having some fun with v4 alpha 6, however, is there a specific reason why the collapse groups, aka accordions, are hooked up on
.card
s?Ideally, I would be able to make my own collapse grouping like this (simplified, but you will get my idea):
This would allow us to use collapse groupings on other than cards. The same thing was an annoying issue with 3.x where they are hooked up on panels.
The text was updated successfully, but these errors were encountered: