From 74490346ffe4281ffa37e886adbae597104e7e0b Mon Sep 17 00:00:00 2001 From: Mark Otto Date: Sat, 31 Mar 2018 14:22:01 -0700 Subject: Add new .flex-grow and .flex-shrink utils --- docs/4.0/utilities/flex.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'docs') diff --git a/docs/4.0/utilities/flex.md b/docs/4.0/utilities/flex.md index 2a2dec02a0..83e950cf72 100644 --- a/docs/4.0/utilities/flex.md +++ b/docs/4.0/utilities/flex.md @@ -235,6 +235,35 @@ Responsive variations also exist for `flex-fill`. {% for bp in site.data.breakpoints %} - `.flex{{ bp.abbr }}-fill`{% endfor %} +## Grow and shrink + +Use `.flex-grow-*` utilities to toggle a flex item's ability to grow to fill available space. In the example below, the `.flex-grow-1` elements uses all available space it can, while allowing the remaining two flex items their necessary space. + +{% capture example %} +
+
Flex item
+
Flex item
+
Third flex item
+
+{% endcapture %} +{% include example.html content=example %} + +Use `.flex-shrink-*` utilities to toggle a flex item's ability to shrink if necessary. In the example below, the second flex item with `.flex-shrink-1` is forced to wrap it's contents to a new line, "shrinking" to allow more space for the previous flex item with `.w-100`. + +{% capture example %} +
+
Flex item
+
Flex item
+
+{% endcapture %} +{% include example.html content=example %} + +Responsive variations also exist for `flex-grow` and `flex-shrink`. + +{% for bp in site.data.breakpoints %} +- `.flex{{ bp.abbr }}-{grow|shrink}-0` +- `.flex{{ bp.abbr }}-{grow|shrink}-1`{% 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`). -- cgit v1.2.3