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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add order-last grid class #24915

Merged
merged 3 commits into from
Jan 16, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/4.0/layout/grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,14 @@ Use `.order-` classes for controlling the **visual order** of your content. Thes
{% endexample %}
</div>

There's also a responsive `.order-first` class that quickly changes the order of one element by applying `order: -1`. This class can also be intermixed with the numbered `.order-*` classes as needed.
There are also responsive `.order-first` and `.order-last` classes that change the `order` of an element by applying `order: -1` and `order: 13` (`order: $columns + 1`), respectively. These classes can also be intermixed with the numbered `.order-*` classes as needed.

<div class="bd-example-row">
{% example html %}
<div class="container">
<div class="row">
<div class="col">
First, but unordered
<div class="col order-last">
First, but last
</div>
<div class="col">
Second, but unordered
Expand Down
10 changes: 4 additions & 6 deletions scss/mixins/_grid-framework.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,12 @@
}
}

.order#{$infix}-first {
order: -1;
}
.order#{$infix}-first { order: -1; }

.order#{$infix}-last { order: $columns + 1; }

@for $i from 0 through $columns {
.order#{$infix}-#{$i} {
order: $i;
}
.order#{$infix}-#{$i} { order: $i; }
}

// `$columns - 1` because offsetting by the width of an entire row isn't possible
Expand Down