]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add order first to grid (#24202)
authorLuke Frake <lukefrake@gmail.com>
Tue, 3 Oct 2017 01:56:13 +0000 (02:56 +0100)
committerMark Otto <markd.otto@gmail.com>
Tue, 3 Oct 2017 01:56:13 +0000 (18:56 -0700)
* Add first class to grid framework to add negative ordering

* Add order-first explination to the docs

docs/4.0/layout/grid.md
scss/mixins/_grid-framework.scss

index 4a1a55e18fa0d31efb23c92ea9a493fbc05fcfc2..a194bd8401ed9dfa11b602d6af6426db088c099a 100644 (file)
@@ -535,6 +535,26 @@ 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.
+
+<div class="bd-example-row">
+{% example html %}
+<div class="container">
+  <div class="row">
+    <div class="col">
+      First, but unordered
+    </div>
+    <div class="col">
+      Second, but unordered
+    </div>
+    <div class="col order-first">
+      Third, but first
+    </div>
+  </div>
+</div>
+{% endexample %}
+</div>
+
 ### Offsetting columns
 
 You can offset grid columns in two ways: our responsive `.offset-` grid classes and our [margin utilities]({{ site.baseurl }}/docs/{{ site.docs_version }}/utilities/spacing/). Grid classes are sized to match columns while margins are more useful for quick layouts where the width of the offset is variable.
index 5e7d1ffb547f4122a310c275b3b454c7f0b4eff7..41bdf4646da2140fc46a514131a7886bfbc961f8 100644 (file)
         }
       }
 
+      .order#{$infix}-first {
+        order: -1;
+      }
+
       @for $i from 1 through $columns {
         .order#{$infix}-#{$i} {
           order: $i;