]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Output a blank media query if xxlarge down is used, since 'xxlarge down' basically...
authorGeoff Kimball <geoff@zurb.com>
Tue, 26 Jan 2016 00:12:44 +0000 (16:12 -0800)
committerGeoff Kimball <geoff@zurb.com>
Tue, 26 Jan 2016 00:12:44 +0000 (16:12 -0800)
scss/util/_breakpoint.scss
test/sass/_breakpoint.scss

index 9cfdd8d8f3920553a6d8c8dc274cdc24519984c3..c25231857b382f5e270f6e25bc7c25952f0d56a2 100644 (file)
@@ -101,7 +101,9 @@ $breakpoint-classes: (small medium large) !default;
       // Skip media query creation if input value is exactly "0 down",
       // unless the function was called as "small down", in which case it's just "small only"
       @if $named or $bp > 0em {
-        $str: $str + '(max-width: #{$max})';
+        @if $max != null {
+          $str: $str + '(max-width: #{$max})';
+        }
       }
     }
 
index 23f6aaf7af880bef6e518d067a9e68e4e5c2dd85..f525c9158693f60752c505d220df1de7289579ae 100755 (executable)
@@ -4,7 +4,7 @@
 @import '../../scss/util/breakpoint';
 
 @include test-module('Breakpoint') {
-  
+
   @include test('Breakpoint (Named to Em) [function]') {
     $test: breakpoint(medium);
     $expect: '(min-width: 40em)';
@@ -25,7 +25,7 @@
   @include test('Breakpoint (Only Range) [function]') {
     $test: breakpoint(medium only);
     $expect: '(min-width: 40em) and (max-width: 63.9375em)';
-    
+
     $test-lowest: breakpoint(small only);
     $expect-lowest: '(max-width: 39.9375em)';
 
 
     @include assert-equal($test, $expect,
       'Creates a min/max-width range out of a named breakpoint');
-    
+
     @include assert-equal($test-lowest, $expect-lowest,
       'Creates a max-width range if the breakpoint is the lowest');
-    
+
     @include assert-equal($test-highest, $expect-highest,
       'Creates a min-width range if the breakpoint is the highest');
   }
 
   @include test('Breakpoint (Named Down Range) [function]') {
-    $test_medium: breakpoint(medium down);
-    $expect_medium: '(max-width: 63.9375em)';
+    $test: breakpoint(medium down);
+    $expect: '(max-width: 63.9375em)';
 
-    @include assert-equal($test_medium, $expect_medium,
+    @include assert-equal($test, $expect,
       'Creates a down range out of a medium breakpoint');
-    
-    $test_small: breakpoint(small down);
-    $expect_small: '(max-width: 39.9375em)';
 
-    @include assert-equal($test_small, $expect_small,
+    $test-lowest: breakpoint(small down);
+    $expect-lowest: '(max-width: 39.9375em)';
+
+    @include assert-equal($test-lowest, $expect-lowest,
       'Creates a down range out of a small breakpoint');
+
+    $test-highest: breakpoint(xxlarge down);
+    $expect-highest: '';
+
+    @include assert-equal($test-highest, $expect-highest,
+      'Skips media query creation for xxlarge down');
   }
 
   @include test('Breakpoint (Value Down Range) [function]') {
 
     @include assert-equal($test_next, $expect_next,
       'Returns the next value in a map');
-    
+
     $test_last: -zf-map-next($input, three);
     $expect_last: null;
-    
+
     @include assert-equal($test_last, $expect_last,
       'Returns null if the key is last in the map');
 
 
     @include assert-equal($test_kittens, $expect_kittens,
       'Given a non-existant breakpoint name, return null');
-    
+
     $test_match: -zf-get-bp-val($config, large);
     $expect_match: 1;