Add an order class to be before unspecified columns (like flex-first did previously)
Created by: chrisblakley
Like I mentioned in another issue, I love how intuitive the new order classes are! However, when playing with them tonight I found that there is no way to move a div unless other divs in the row are also specified.
Since the default flex order is 0, the Bootstrap order classes can only move divs to the right of an unspecified div (such as .col or .col-md).
<div class="row">
<div class="col-md">
Unspecified column width. This will be first no matter what (default flex order of 0).
</div>
<div class="col-md order-1">
Order declared, but remains right of unspecified column(s).
</div>
</div>
Previous solution
In the alphas, we had access to the class flex-first which would force the div to be the first column regardless (by setting the order to -1). I think the idea of this can be included while still maintaining the simplicity of the order classes.
Proposed solutions
- Having a class with the property of
order: -1would be one idea. Maybeorder-first,order-before,order-0, or even the formerflex-first, or something completely different (just spitballing).- I'd hate to slip down the slope of requesting 12 more order classes for negative numbers, but maybe we could introduce one class to force a column first?
- The default order could be changed as well, but this would cause the opposite problem.
- Another solution could be to ignore it and just require devs to implement their own class if they want to reorder a column to be before an unspecified Bootstrap column
div.
I want to make sure Bootstrap retains as much functionality as possible to allow these "width agnostic" columns because it is such a powerful feature that allows for so much elegant flexibility when developing.