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
  • !21425

v4: Flex modal

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge flex-modal into v4-dev Dec 25, 2016
  • Overview 0
  • Commits 6
  • Pipelines 0
  • Changes 3

This revamps the modal to use flexbox for it's .modal-content, .modal-header, .modal-body, and .modal-footer elements. This requires some markup changes on your end, but comes with added flexibility around customizing placement and alignment of content within a modal. Here's what's changed.

Modals now use display: flex and flex-direction: column. While likely an edge case, this allows for easy changes in orientation and alignment. For example, add .flex-row and .align-items-start to get started with a horizontal modal layout.

Modal headers and footers now use display: flex and some flex alignment properties. In the header, we flipped the order of the DOM elements (dismiss used to come first, not it comes last) and then align the contents to the edges. In the footer, we made no markup changes, but also added display: flex with some flex alignment properties. In addition, the footer also has some horizontal margin love for easily spacing buttons and more (since flexbox doesn't render HTML spaces like inline-block does).

Modal body is set to grow, should you add a fixed height to a .modal-content. This ensures that no matter the height on .modal-content, your .modal-body will grow to keep the header at the very top and the footer at the very bottom.


I still plan on exploring some more flexbox things here, but o

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: flex-modal