mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-20 20:00:36 +03:00
Add Error checking to prevent invalid breakpoint (#28889)
* Add Error checking to prevent invalid breakpoint Error checking to prevent invalid breakpoint name * check type rather than value * Revert "check type rather than value" This reverts commit 04ab1e652f9c9c1c7725b7328b12f548a2c6d142. * use of not rather than null
This commit is contained in:
committed by
Martijn Cuppens
parent
0829decce0
commit
c5b1919dea
@@ -16,7 +16,10 @@
|
|||||||
// md
|
// md
|
||||||
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
|
||||||
$n: index($breakpoint-names, $name);
|
$n: index($breakpoint-names, $name);
|
||||||
@return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
|
@if not $n {
|
||||||
|
@error "breakpoint `#{$name}` not found in `#{$breakpoints}`";
|
||||||
|
}
|
||||||
|
@return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Minimum breakpoint width. Null for the smallest (first) breakpoint.
|
// Minimum breakpoint width. Null for the smallest (first) breakpoint.
|
||||||
|
|||||||
Reference in New Issue
Block a user