]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Re-use 'between' mixin for 'only' mixin 20101/head
authorheath3 <heath3@users.noreply.github.com>
Thu, 9 Jun 2016 15:07:27 +0000 (16:07 +0100)
committerheath3 <heath3@users.noreply.github.com>
Thu, 9 Jun 2016 15:07:27 +0000 (16:07 +0100)
Keeps the code DRY in the same way 'between' uses 'up' and 'down'.

scss/mixins/_breakpoints.scss

index a868833b45eba156ed36a498eb5a5597c5f1a546..5abe25266621f9bf18a8e8a3c1bc0aa4dbf0b917 100644 (file)
   }
 }
 
-// Media between the breakpoint's minimum and maximum widths.
-// No minimum for the smallest breakpoint, and no maximum for the largest one.
-// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
-@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
-  @include media-breakpoint-up($name, $breakpoints) {
-    @include media-breakpoint-down($name, $breakpoints) {
-      @content;
-    }
-  }
-}
-
 // Media that spans multiple breakpoint widths.
 // Makes the @content apply between the min and max breakpoints
 @mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {
     }
   }
 }
+
+// Media between the breakpoint's minimum and maximum widths.
+// No minimum for the smallest breakpoint, and no maximum for the largest one.
+// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.
+@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {
+  @include media-breakpoint-between($name, $name, $breakpoints) {
+    @content;
+  }
+}