1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-14 01:24:19 +02:00

Add Error checking to prevent invalid breakpoint

Error checking to prevent invalid breakpoint name
This commit is contained in:
Ashfahan Khan
2019-06-11 10:05:36 +05:00
committed by GitHub
parent 2ac2a5a91e
commit 92e6fd4b25

View File

@@ -16,7 +16,10 @@
// md
@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {
$n: index($breakpoint-names, $name);
@return if($n != null and $n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);
@if $n == null {
@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.