]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Add basic property-value utils for position
authorMark Otto <markdotto@gmail.com>
Tue, 8 Aug 2017 05:36:57 +0000 (22:36 -0700)
committerMark Otto <markd.otto@gmail.com>
Fri, 11 Aug 2017 05:35:38 +0000 (22:35 -0700)
docs/4.0/utilities/position.md
scss/utilities/_position.scss

index fb7d8bd9eab21c30b028b6819f6712bd3cb42aa0..9cf952452e98dbfef3867b2b3cf50e14678da566 100644 (file)
@@ -6,6 +6,18 @@ group: utilities
 toc: true
 ---
 
+## Common values
+
+Quick positioning classes are available, though they are not responsive.
+
+{% highlight html %}
+<div class="position-static">...</div>
+<div class="position-relative">...</div>
+<div class="position-absolute">...</div>
+<div class="position-fixed">...</div>
+<div class="position-sticky">...</div>
+{% endhighlight %}
+
 ## Fixed top
 
 Position an element at the top of the viewport, from edge to edge. Be sure you understand the ramifications of fixed position in your project; you may need to add aditional CSS.
index 74b8d39e7030a5aabd4651436fb3766dc3f757a7..bddae2151c9f365991a70af557e37d8ddee6096d 100644 (file)
@@ -1,4 +1,13 @@
-// Positioning
+// Common values
+
+// Sass list not in variables since it's not intended for customization.
+$positions: static, relative, absolute, fixed, sticky;
+
+@each $position in $positions {
+  .position-#{$position} { position: $position !important; }
+}
+
+// Shorthand
 
 .fixed-top {
   position: fixed;