Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce .flex-column-reverse utility #927

Merged
merged 3 commits into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions docs/content/utilities/flexbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bundle: utilities

Flex utilities can be used to apply `flexbox` behaviors to elements by using utility classes.



## Required reading

Expand Down Expand Up @@ -64,9 +64,10 @@ Use these classes to define the orientation of the main axis (`row` or `column`)
#### CSS

```css
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-column { flex-direction: column; }
.flex-column-reverse { flex-direction: column-reverse; }
```

#### Classes
Expand All @@ -76,6 +77,7 @@ Use these classes to define the orientation of the main axis (`row` or `column`)
| `.flex-row` | The main axis runs left to right (default). |
| `.flex-row-reverse` | The main axis runs right to left. |
| `.flex-column` | The main axis runs top to bottom. |
| `.flex-column-reverse` | The main axis runs bottom to top. |

#### Example using `.flex-column`

Expand All @@ -87,6 +89,18 @@ Use these classes to define the orientation of the main axis (`row` or `column`)
</div>
```

#### Example using `.flex-column-reverse`

This example uses the responsive variant `.flex-md-column-reverse` to override `.flex-column` Learn more about responsive flexbox utilities **[here](#responsive-flex-utilities)**. Keep in mind that it won't affect screen readers or navigating with the keyboard and it's advised to keep the markup in a logical source order.

```html live
<div class="border d-flex flex-column flex-md-column-reverse">
<div class="p-5 border bg-gray-light">Item 1</div>
<div class="p-5 border bg-gray-light">Item 2</div>
<div class="p-5 border bg-gray-light">Item 3</div>
</div>
```

#### Example using `.flex-row`

This example uses the responsive variant `.flex-md-row` to override `.flex-column` Learn more about responsive flexbox utilities **[here](#responsive-flex-utilities)**.
Expand All @@ -101,7 +115,7 @@ This example uses the responsive variant `.flex-md-row` to override `.flex-colum

#### Example using `.flex-row-reverse`

This example uses the responsive variant `.flex-md-row-reverse` to override `.flex-column` Learn more about responsive flexbox utilities **[here](#responsive-flex-utilities)**.
This example uses the responsive variant `.flex-md-row-reverse` to override `.flex-column` Learn more about responsive flexbox utilities **[here](#responsive-flex-utilities)**. Keep in mind that it won't affect screen readers or navigating with the keyboard and it's advised to keep the markup in a logical source order.

```html live
<div class="border d-flex flex-column flex-md-row-reverse">
Expand Down
7 changes: 4 additions & 3 deletions src/utilities/flexbox.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
@include breakpoint($breakpoint) {
// Flexbox classes
// Container
.flex#{$variant}-row { flex-direction: row !important; }
.flex#{$variant}-row-reverse { flex-direction: row-reverse !important; }
.flex#{$variant}-column { flex-direction: column !important; }
.flex#{$variant}-row { flex-direction: row !important; }
.flex#{$variant}-row-reverse { flex-direction: row-reverse !important; }
.flex#{$variant}-column { flex-direction: column !important; }
.flex#{$variant}-column-reverse { flex-direction: column-reverse !important; }

.flex#{$variant}-wrap { flex-wrap: wrap !important; }
.flex#{$variant}-nowrap { flex-wrap: nowrap !important; }
Expand Down