Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B bootstrap
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 263
    • Issues 263
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 114
    • Merge requests 114
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Bootstrap
  • bootstrap
  • Merge requests
  • !31995

Replace `.btn-block` with utilities

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge btn-block-responsive into main Oct 27, 2020
  • Overview 2
  • Commits 2
  • Pipelines 0
  • Changes 4

This now replaces .btn-block with .d-grid and .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-block from a .btn modifier 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", adding w-100 basically 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 with media-breakpoint-down(), so they use max-width instead of min-width in 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-stack or 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

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: btn-block-responsive