]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Added position helpers mixin to prototype classes (including respective breakpoints)
authorharry <harmanmanchanda182@gmail.com>
Thu, 2 Feb 2017 16:06:14 +0000 (21:36 +0530)
committerharry <harmanmanchanda182@gmail.com>
Thu, 2 Feb 2017 16:06:14 +0000 (21:36 +0530)
Includes
- position-static
- position-relative
- position-absolute
- position-fixed
- position-fixed-top
- position-fixed-bottom

scss/prototype/_position.scss [new file with mode: 0644]
scss/prototype/_prototype.scss

diff --git a/scss/prototype/_position.scss b/scss/prototype/_position.scss
new file mode 100644 (file)
index 0000000..85f0e3d
--- /dev/null
@@ -0,0 +1,66 @@
+// Foundation for Sites by ZURB
+// foundation.zurb.com
+// Licensed under MIT Open Source
+
+////
+/// @group prototype-position
+////
+
+/// z-index for fixed positioning
+/// @type Number
+$position-zindex: 975 !default;
+
+@mixin position-fixed-top {
+  position: fixed;
+  top: 0;
+  right: 0;
+  left: 0;
+  z-index: $position-zindex;
+}
+
+@mixin position-fixed-bottom {
+  position: fixed;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: $position-zindex;
+}
+
+@mixin foundation-prototype-position {
+       @each $size in $breakpoint-classes {
+    @include breakpoint($size) {
+      // Position: Static, Relative, Fixed, Absolute
+      @each $position in (static, relative, absolute, fixed) {
+        @if $size != $-zf-zero-breakpoint {
+          .#{$size}-position-#{$position} {
+                             position: $position;
+                           }
+        }
+        @else {
+          .position-#{$position} {
+                             position: $position;
+                           }
+        }
+      }
+      // Position: Fixed Top, Fixed Bottom
+      @if $size != $-zf-zero-breakpoint {
+        .#{$size}-position-fixed-top {
+          @include position-fixed-top;
+        }
+
+        .#{$size}-position-fixed-bottom {
+          @include position-fixed-bottom;
+        }
+      }
+      @else {
+        .position-fixed-top {
+          @include position-fixed-top;
+        }
+
+        .position-fixed-bottom {
+          @include position-fixed-bottom;
+        }
+      }
+    }
+  }
+}
index 02c19d788cba08ba70410f9376ab3c290565f15d..bb722b72d2448306fc95e59e8be8451a7d3ac4f5 100644 (file)
@@ -28,7 +28,7 @@
 @import 'font-styling';
 
 // Position Helpers
-// @import 'position';
+@import 'position';
 
 // Spacing Utilities
 // @import 'spacing';
@@ -56,4 +56,5 @@
   @include foundation-prototype-text-transformation;
   @include foundation-prototype-text-decoration;
   @include foundation-prototype-font-styling;
+  @include foundation-prototype-position;
 }