1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-26 14:54:27 +02:00

Remove lots of duplication + minor cleanup (#21238)

* Remove comment that duplicated some code
* Use transition mixin whenever possible
* Create a new function to reduce duplication
* Use the new `breakpoint-infix` method
This commit is contained in:
Starsam80
2016-11-28 14:23:59 -07:00
committed by Mark Otto
parent 2f9a94caac
commit b226766b62
13 changed files with 88 additions and 195 deletions

View File

@@ -38,6 +38,17 @@
@return if($next, breakpoint-min($next, $breakpoints) - 1px, null);
}
// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.
// Useful for making responsive utilities.
//
// >> breakpoint-infix(xs, (xs: 0, sm: 544px, md: 768px))
// "" (Returns a blank string)
// >> breakpoint-infix(sm, (xs: 0, sm: 544px, md: 768px))
// "-sm"
@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {
@return if(breakpoint-min($name, $breakpoints) == null, "", "-#{$name}");
}
// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.
// Makes the @content apply to the given breakpoint and wider.
@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {