]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: revert to Sass default 5-digit precision for breakpoint gutters 10978/head
authorNicolas Coden <nicolas@ncoden.fr>
Fri, 30 Mar 2018 21:02:15 +0000 (23:02 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Fri, 30 Mar 2018 21:02:15 +0000 (23:02 +0200)
I was wrong, Sass actually has a default precision of 5 digits. Bootstrap-sass uses 8 digits but require to update the Sass compiler options.
See: https://github.com/twbs/bootstrap-sass#sass-number-precision

Note: this also update breakpoint tests

scss/components/_visibility.scss
scss/util/_breakpoint.scss
test/sass/_breakpoint.scss

index f649055cb66292c82777770051231e6df8a3d77d..75472918adf501df10c84bd00973c799dae4ed12 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) - .000001;
+  $size: -zf-bp-to-em($size) - .00001;
 
   @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) - .000001;
+  $lower-bound: -zf-bp-to-em($lower-bound-size) - .00001;
   // 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 9865ed520dd31f789e13d58be26d8a6f53112af4..733dab09c6153c75db58b9f0c94155843d780a2c 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) - .000001;
+    $bp-max: -zf-bp-to-em($bp-max) - .00001;
   }
 
   // Conditions to skip media query creation
index ef2754facc9657ded0fce981ebf004d400b7a899..1ea9badf981b96bb99590ba9e8bb9a4c5745b27a 100755 (executable)
 
   @include test('Breakpoint (Only Range) [function]') {
     $test: breakpoint(medium only);
-    $expect: '(min-width: 40em) and (max-width: 63.9999em)';
+    $expect: '(min-width: 40em) and (max-width: 63.99999em)';
 
     $test-lowest: breakpoint(small only);
-    $expect-lowest: '(max-width: 39.9999em)';
+    $expect-lowest: '(max-width: 39.99999em)';
 
     $test-highest: breakpoint(xxlarge only);
     $expect-highest: '(min-width: 90em)';
 
   @include test('Breakpoint (Named Down Range) [function]') {
     $test: breakpoint(medium down);
-    $expect: '(max-width: 63.9999em)';
+    $expect: '(max-width: 63.99999em)';
 
     @include assert-equal($test, $expect,
       'Creates a down range out of a medium breakpoint');
 
     $test-lowest: breakpoint(small down);
-    $expect-lowest: '(max-width: 39.9999em)';
+    $expect-lowest: '(max-width: 39.99999em)';
 
     @include assert-equal($test-lowest, $expect-lowest,
       'Creates a down range out of a small breakpoint');