]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Use pull request #10978 from JasonMiller/breakpoint-mixin-max-width-values for v6.5.0
authorJasonMiller <jason.miller@revzilla.com>
Sat, 16 Jun 2018 07:49:42 +0000 (09:49 +0200)
committerNicolas Coden <nicolas@ncoden.fr>
Sat, 16 Jun 2018 20:58:48 +0000 (22:58 +0200)
b50a45aa0 decrement bp-max by 0.0001 rather than 1/16
283483aca update max-widths values
74254be7c remove leading zero from bp-max decrement
fc749cd71 fix: use 6-decimal precision between breakpoint
cc9279493 fix: revert to Sass default 5-digit precision for breakpoint gutters

Co-Authored-By: Nicolas Coden <nicolas@ncoden.fr>
Signed-off-by: Nicolas Coden <nicolas@ncoden.fr>
scss/components/_visibility.scss
scss/util/_breakpoint.scss
test/sass/_breakpoint.scss

index 8906f5977fac4b9d2994a1dab0d02bca70cf6209..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) - (1 / 16);
+  $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) - (1 / 16);
+  $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 23bc7770e2c5a0993f6b82c9f500028484adc446..39f6fc8b08c7774a221034a55d90a636b6452e9f 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) - (1/16);
+    $bp-max: -zf-bp-to-em($bp-max) - .00001;
   }
 
   // Conditions to skip media query creation
index d013ac47dfd84048f21bfd1ab161c261922567e2..1ea9badf981b96bb99590ba9e8bb9a4c5745b27a 100755 (executable)
 
   @include test('Breakpoint (Only Range) [function]') {
     $test: breakpoint(medium only);
-    $expect: '(min-width: 40em) and (max-width: 63.9375em)';
+    $expect: '(min-width: 40em) and (max-width: 63.99999em)';
 
     $test-lowest: breakpoint(small only);
-    $expect-lowest: '(max-width: 39.9375em)';
+    $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.9375em)';
+    $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.9375em)';
+    $expect-lowest: '(max-width: 39.99999em)';
 
     @include assert-equal($test-lowest, $expect-lowest,
       'Creates a down range out of a small breakpoint');
     @include assert-equal(-zf-get-bp-val($config, xlarge), 1,
       'Given a nearby breakpoint, returns the next lowest value');
   }
-
 }