diff --git a/docs/assets/scss/_component-examples.scss b/docs/assets/scss/_component-examples.scss
index dea8eb5f34..01cd018710 100644
--- a/docs/assets/scss/_component-examples.scss
+++ b/docs/assets/scss/_component-examples.scss
@@ -19,9 +19,9 @@
}
}
- .flex-items-xs-top,
- .flex-items-xs-middle,
- .flex-items-xs-bottom {
+ .flex-items-top,
+ .flex-items-middle,
+ .flex-items-bottom {
min-height: 6rem;
background-color: rgba(255,0,0,.1);
}
diff --git a/docs/components/list-group.md b/docs/components/list-group.md
index 49a6ced631..820470bbba 100644
--- a/docs/components/list-group.md
+++ b/docs/components/list-group.md
@@ -46,19 +46,19 @@ Add badges to any list group item to show unread counts, activity, etc.
{% endexample %}
-When in flexbox mode, you'll need to rearrange the contents of your list group items. To replicate the right-aligned badges as shown above, use the following example's code. Note the [`flex-items-xs-between` utility class]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), the badge's placement, and the lack of a float utility on the badges.
+When in flexbox mode, you'll need to rearrange the contents of your list group items. To replicate the right-aligned badges as shown above, use the following example's code. Note the [`flex-items-between` utility class]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), the badge's placement, and the lack of a float utility on the badges.
{% highlight html %}
- -
+
-
Cras justo odio
14
- -
+
-
Dapibus ac facilisis in
2
- -
+
-
Morbi leo risus
1
diff --git a/docs/components/navs.md b/docs/components/navs.md
index 86fd0463fc..7ac1b52324 100644
--- a/docs/components/navs.md
+++ b/docs/components/navs.md
@@ -282,7 +282,7 @@ And pills, too:
Using our [flexbox utilities]({{ site.baseurl }}/layout/flexbox-grid/#horizontal-alignment), you can also customize your navigation components to change the alignment of nav items. For example, here are center aligned links on the inline nav component.
{% example html %}
-
+
-
Active
diff --git a/docs/layout/flexbox-grid.md b/docs/layout/flexbox-grid.md
index eafe7b59c5..4823925041 100644
--- a/docs/layout/flexbox-grid.md
+++ b/docs/layout/flexbox-grid.md
@@ -157,7 +157,7 @@ Use the flexbox alignment utilities to vertically align columns.
{% example html %}
-
+
One of three columns
@@ -168,7 +168,7 @@ Use the flexbox alignment utilities to vertically align columns.
One of three columns
-
+
One of three columns
@@ -179,7 +179,7 @@ Use the flexbox alignment utilities to vertically align columns.
One of three columns
-
+
One of three columns
@@ -198,13 +198,13 @@ Use the flexbox alignment utilities to vertically align columns.
{% example html %}
-
+
One of three columns
-
+
One of three columns
-
@@ -219,7 +219,7 @@ Flexbox utilities for horizontal alignment also exist for a number of layout opt
{% example html %}
-
+
One of two columns
@@ -227,7 +227,7 @@ Flexbox utilities for horizontal alignment also exist for a number of layout opt
One of two columns
-
+
One of two columns
@@ -235,7 +235,7 @@ Flexbox utilities for horizontal alignment also exist for a number of layout opt
One of two columns
-
+
One of two columns
@@ -243,7 +243,7 @@ Flexbox utilities for horizontal alignment also exist for a number of layout opt
One of two columns
-
+
One of two columns
@@ -251,7 +251,7 @@ Flexbox utilities for horizontal alignment also exist for a number of layout opt
One of two columns
-
+
One of two columns
@@ -271,13 +271,13 @@ Flexbox utilities for controlling the **visual order** of your content.
{% example html %}
-
+
First, but unordered
-
+
Second, but last
-
diff --git a/scss/utilities/_flex.scss b/scss/utilities/_flex.scss
index 502885a81e..6e3c39b8f7 100644
--- a/scss/utilities/_flex.scss
+++ b/scss/utilities/_flex.scss
@@ -4,34 +4,54 @@
@if $enable-flex {
@each $breakpoint in map-keys($grid-breakpoints) {
- // Flex column reordering
@include media-breakpoint-up($breakpoint) {
- .flex-#{$breakpoint}-first { order: -1; }
- .flex-#{$breakpoint}-last { order: 1; }
- .flex-#{$breakpoint}-unordered { order: 0; }
- }
+ $min: breakpoint-min($breakpoint, $grid-breakpoints);
- // Alignment for every item
- @include media-breakpoint-up($breakpoint) {
- .flex-items-#{$breakpoint}-top { align-items: flex-start; }
- .flex-items-#{$breakpoint}-middle { align-items: center; }
- .flex-items-#{$breakpoint}-bottom { align-items: flex-end; }
- }
+ @if $min {
+ // Flex column reordering
+ .flex-#{$breakpoint}-first { order: -1; }
+ .flex-#{$breakpoint}-last { order: 1; }
+ .flex-#{$breakpoint}-unordered { order: 0; }
- // Alignment per item
- @include media-breakpoint-up($breakpoint) {
- .flex-#{$breakpoint}-top { align-self: flex-start; }
- .flex-#{$breakpoint}-middle { align-self: center; }
- .flex-#{$breakpoint}-bottom { align-self: flex-end; }
- }
+ // Alignment for every item
+ .flex-items-#{$breakpoint}-top { align-items: flex-start; }
+ .flex-items-#{$breakpoint}-middle { align-items: center; }
+ .flex-items-#{$breakpoint}-bottom { align-items: flex-end; }
- // Horizontal alignment of item
- @include media-breakpoint-up($breakpoint) {
- .flex-items-#{$breakpoint}-left { justify-content: flex-start; }
- .flex-items-#{$breakpoint}-center { justify-content: center; }
- .flex-items-#{$breakpoint}-right { justify-content: flex-end; }
- .flex-items-#{$breakpoint}-around { justify-content: space-around; }
- .flex-items-#{$breakpoint}-between { justify-content: space-between; }
+ // Alignment per item
+ .flex-#{$breakpoint}-top { align-self: flex-start; }
+ .flex-#{$breakpoint}-middle { align-self: center; }
+ .flex-#{$breakpoint}-bottom { align-self: flex-end; }
+
+ // Horizontal alignment of item
+ .flex-items-#{$breakpoint}-left { justify-content: flex-start; }
+ .flex-items-#{$breakpoint}-center { justify-content: center; }
+ .flex-items-#{$breakpoint}-right { justify-content: flex-end; }
+ .flex-items-#{$breakpoint}-around { justify-content: space-around; }
+ .flex-items-#{$breakpoint}-between { justify-content: space-between; }
+ } @else {
+ // Flex column reordering
+ .flex-first { order: -1; }
+ .flex-last { order: 1; }
+ .flex-unordered { order: 0; }
+
+ // Alignment for every item
+ .flex-items-top { align-items: flex-start; }
+ .flex-items-middle { align-items: center; }
+ .flex-items-bottom { align-items: flex-end; }
+
+ // Alignment per item
+ .flex-top { align-self: flex-start; }
+ .flex-middle { align-self: center; }
+ .flex-bottom { align-self: flex-end; }
+
+ // Horizontal alignment of item
+ .flex-items-left { justify-content: flex-start; }
+ .flex-items-center { justify-content: center; }
+ .flex-items-right { justify-content: flex-end; }
+ .flex-items-around { justify-content: space-around; }
+ .flex-items-between { justify-content: space-between; }
+ }
}
}
}