]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: use 6-decimal precision between breakpoint
authorNicolas Coden <nicolas@ncoden.fr>
Sun, 25 Mar 2018 15:39:19 +0000 (17:39 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sun, 25 Mar 2018 15:39:19 +0000 (17:39 +0200)
6 decimals is an arbitrary choice. Big enough to give sub-pixels renderd widths in mose use cases and small enough to not being round by browsers.

scss/components/_visibility.scss
scss/util/_breakpoint.scss

index 8906f5977fac4b9d2994a1dab0d02bca70cf6209..f649055cb66292c82777770051231e6df8a3d77d 100644 (file)
@@ -6,7 +6,7 @@
 /// @param {Keyword} $size - Breakpoint to use. **Must be a breakpoint defined in `$breakpoints`.**
 @mixin show-for($size) {
   $size: map-get($breakpoints, $size);
-  $size: -zf-bp-to-em($size) - (1 / 16);
+  $size: -zf-bp-to-em($size) - .000001;
 
   @include breakpoint($size down) {
     display: none !important;
@@ -20,7 +20,7 @@
   $upper-bound-size: -zf-map-next($breakpoints, $size);
 
   // more often than not this will be correct, just one time round the loop it won't so set in scope here
-  $lower-bound: -zf-bp-to-em($lower-bound-size) - (1 / 16);
+  $lower-bound: -zf-bp-to-em($lower-bound-size) - .000001;
   // test actual lower-bound-size, if 0 set it to 0em
   @if strip-unit($lower-bound-size) == 0 {
     $lower-bound: -zf-bp-to-em($lower-bound-size);
index a9f5f4a72d53de369bd8cc13b0bf2a64a833a0df..9865ed520dd31f789e13d58be26d8a6f53112af4 100644 (file)
@@ -77,7 +77,7 @@ $breakpoint-classes: (small medium large) !default;
   // Convert any pixel, rem, or unitless value to em
   $bp: -zf-bp-to-em($bp);
   @if $bp-max {
-    $bp-max: -zf-bp-to-em($bp-max) - .0001;
+    $bp-max: -zf-bp-to-em($bp-max) - .000001;
   }
 
   // Conditions to skip media query creation