mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-01 01:21:49 +02:00
Generate correct breakpoints for navbar-toggleable-* and generate toggleable without media query to never collapse
This commit is contained in:
committed by
Mark Otto
parent
d0b568470f
commit
c1325a756e
@@ -16,9 +16,22 @@
|
||||
// md
|
||||
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
||||
$n: index($breakpoint-names, $name);
|
||||
@return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
|
||||
@return if($n, if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null), 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))
|
||||
|
Reference in New Issue
Block a user