Replace .btn-block with utilities#31995
Conversation
3c3e631 to
a1b9dd0
Compare
|
Is your intention with not applying any styling to the non-stacked buttons for utilities to get utilized for customization without having to fight built-in styling? For example, I could see wanting to always have the non-stacked buttons grow horizontally to fill their container (so whitespace is more consistent between stacked and not), but if we made that the default behavior and someone has a different idea for how they want the non-stacked buttons to work, then they'd have to use utilities to first fight that default behavior instead of just applying their own straight-away. |
|
Not convinced of using this approach
|
|
Do we leave this as custom CSS then, or provide helpers/utilities to enable those kind of layouts? See my comment at #32034 (comment) for something I've been thinking about since seeing that issue and another OSS project. |
|
@MartijnCuppens Could we do something like this when #32066 ships? https://codepen.io/emdeoh/pen/zYBLbOM Wondering how to handle a |
4cc2327 to
f368bc5
Compare
|
We can't combine the gap & gutter utilities (yet), since some browsers don't support flex gap yet (https://caniuse.com/flexbox-gap). But we can indeed introduce new |
f368bc5 to
68d8381
Compare
68d8381 to
f516191
Compare
|
@MartijnCuppens This is now completely revamped to use |
.btn-block with utilities
This now replaces
.btn-blockwith.d-gridand.gap-*utilities. This enables responsive behaviors for the former.btn-block, while also making it much more customizable for responsive behaviors and more.Moves.btn-blockfrom a.btnmodifier class to a parent wrapper, allowing us to more easily manipulate a group of buttons. For folks who want an individual button to be "block level", addingw-100basically accomplishes that. This now makes it possible for a group of buttons to start off stacked and then go inline once a breakpoint is reached.Unlike most of our responsive classes, these are built withmedia-breakpoint-down(), so they usemax-widthinstead ofmin-widthin their media queries. Anecdotally, this fits the pattern of responsiveness for a group of buttons—you stack them on narrow viewports and expand them into a single line when there's available space.I think I need to take another pass at the copy in the docs still. Beyond that, I'm also considering changing this to.btn-stackor something similar. If we did that, we might be able to backport this to v4 as a new feature in v4.6.0. Thoughts?Preview: https://deploy-preview-31995--twbs-bootstrap.netlify.app/docs/5.0/components/buttons/#block-buttons