Skip to content
GitLab
    • Explore Projects Groups Snippets
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
  • !25385

Flex fill util

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Mark Otto requested to merge flex-fill-util into v4-dev 7 years ago
  • Overview 0
  • Commits 2
  • Pipelines 0
  • Changes 2

Cherry-picks from #22229 and adds docs.

Compare
  • v4-dev (base)

and
  • latest version
    02f95589
    2 commits, 2 years ago

2 files
+ 18
- 0

    Preferences

    File browser
    Compare changes
docs/4.0/‎utilities‎
fle‎x.md‎ +17 -0
scss/ut‎ilities‎
_flex‎.scss‎ +1 -0
docs/4.0/utilities/flex.md
+ 17
- 0
  • View file @ 02f95589

  • Edit in single-file editor

  • Open in Web IDE


@@ -213,6 +213,23 @@ Responsive variations also exist for `align-self`.
- `.align-self{{ bp.abbr }}-baseline`
- `.align-self{{ bp.abbr }}-stretch`{% endfor %}
## Fill
Use the `.flex-fill` class on a series of sibling elements to force them into equal widths while taking up all available horizontal space. [Especially useful for equal-width, or justified, navigation.]({{ site.baseurl }}/docs/{{ site.docs_version }}/components/navs/#working-with-flex-utilities)
{% example html %}
<div class="d-flex bd-highlight">
<div class="p-2 flex-fill bd-highlight">Flex item</div>
<div class="p-2 flex-fill bd-highlight">Flex item</div>
<div class="p-2 flex-fill bd-highlight">Flex item</div>
</div>
{% endexample %}
Responsive variations also exist for `flex-fill`.
{% for bp in site.data.breakpoints %}
- `.flex{{ bp.abbr }}-fill`{% endfor %}
## Auto margins
Flexbox can do some pretty awesome things when you mix flex alignments with auto margins. Shown below are three examples of controlling flex items via auto margins: default (no auto margin), pushing two items to the right (`.mr-auto`), and pushing two items to the left (`.ml-auto`).
scss/utilities/_flex.scss
+ 1
- 0
  • View file @ 02f95589

  • Edit in single-file editor

  • Open in Web IDE


@@ -16,6 +16,7 @@
.flex#{$infix}-wrap { flex-wrap: wrap !important; }
.flex#{$infix}-nowrap { flex-wrap: nowrap !important; }
.flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }
.flex#{$infix}-fill { flex: 1 1 auto !important; }
.justify-content#{$infix}-start { justify-content: flex-start !important; }
.justify-content#{$infix}-end { justify-content: flex-end !important; }
0 Assignees
None
Assign to
0 Reviewers
None
Request review from
Labels
3
css docs v4
3
css docs v4
    Assign labels
  • Manage project labels

Milestone
No milestone
None
None
Time tracking
No estimate or time spent
Lock merge request
Unlocked
3
3 participants
XhmikosR
Mark Otto
Administrator
Reference: twbs/bootstrap!25385
Source branch: flex-fill-util

Menu

Explore Projects Groups Snippets