diff options
| author | Pierre-Denis Vanduynslager <[email protected]> | 2017-01-14 00:33:21 -0500 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-03-23 23:02:28 -0700 |
| commit | 89b47efc32f2c6575ab16f71c2c8e5db3c581d21 (patch) | |
| tree | 931d360070aab1998d0e6a5bca8f7077eabe4733 | |
| parent | c1325a756ef1c19c197566f6889d49410b1dadf5 (diff) | |
| download | bootstrap-89b47efc32f2c6575ab16f71c2c8e5db3c581d21.tar.xz bootstrap-89b47efc32f2c6575ab16f71c2c8e5db3c581d21.zip | |
Simplify generation and get rid of previously added "breakpoint-previous" function
| -rw-r--r-- | scss/_navbar.scss | 8 | ||||
| -rw-r--r-- | scss/mixins/_breakpoints.scss | 15 |
2 files changed, 5 insertions, 18 deletions
diff --git a/scss/_navbar.scss b/scss/_navbar.scss index a0856cb81..517a8aa92 100644 --- a/scss/_navbar.scss +++ b/scss/_navbar.scss @@ -126,11 +126,11 @@ // where your navbar collapses. .navbar-toggleable { @each $breakpoint in map-keys($grid-breakpoints) { - $previous: breakpoint-previous($breakpoint, $grid-breakpoints); - $infix: breakpoint-infix($breakpoint, $grid-breakpoints); + $next: breakpoint-next($breakpoint, $grid-breakpoints); + $infix: breakpoint-infix($next, $grid-breakpoints); &#{$infix} { - @include media-breakpoint-down($previous) { + @include media-breakpoint-down($breakpoint) { .navbar-nav { .dropdown-menu { position: static; @@ -144,7 +144,7 @@ } } - @include media-breakpoint-up($breakpoint) { + @include media-breakpoint-up($next) { flex-direction: row; flex-wrap: nowrap; align-items: center; diff --git a/scss/mixins/_breakpoints.scss b/scss/mixins/_breakpoints.scss index b2d90c447..904b60f7a 100644 --- a/scss/mixins/_breakpoints.scss +++ b/scss/mixins/_breakpoints.scss @@ -16,22 +16,9 @@ // md @function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { $n: index($breakpoint-names, $name); - @return if($n, if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null), null); + @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null); } -// Name of the previous breakpoint, or null for the first breakpoint. -// -// >> breakpoint-previous(sm) -// xs -// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) -// xs -// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl)) -// xs -@function breakpoint-previous($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) { - $n: index($breakpoint-names, $name); - @return if($n != 1, nth($breakpoint-names, $n - 1), null); -}; - // Minimum breakpoint width. Null for the smallest (first) breakpoint. // // >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)) |
