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

Add order-last grid class #24915

Merged
merged 3 commits into from
Jan 16, 2018
Merged

Add order-last grid class #24915

merged 3 commits into from
Jan 16, 2018

Conversation

cahbb
Copy link
Contributor

@cahbb cahbb commented Nov 29, 2017

This PR adds a new .order-last grid class.

It does the exact opposite thing of .order-first. It reorders the target element to be the last using order: $columns + 1;

<div class="container">
  <div class="row">
    <div class="col order-sm-last">
      First by default, but last on sm
    </div>
    <div class="col">
      Second by default, and still second on sm
    </div>
    <div class="col order-sm-first">
      Last by default, but first on sm
    </div>
  </div>
</div>

This gives the user a more intuitive way of understanding how the columns are ordered. Saying "I want this to be the last child on sm" and not begin to figure out how many columns you have in your grid and so on. The child is going to be what you say - the last child.

As it is now you would use the class .order-sm-12 instead of .order-sm-last in the above example.

🚀 💪

@cahbb cahbb changed the title Add order-*-last grid class Add order-last grid class Nov 29, 2017
@mdo
Copy link
Member

mdo commented Jan 16, 2018

I resolved the conflict here and tweaked the white-space of the source code. Should be good to go once tests pass.

@cahbb
Copy link
Contributor Author

cahbb commented Jan 16, 2018

Cool 🚀
I appreciate you including this PR in Bootstrap 👍🏼

@mdo mdo merged commit f4132db into twbs:v4-dev Jan 16, 2018
@mdo mdo mentioned this pull request Jan 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants