aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2016-10-27 22:28:24 -0700
committerMark Otto <[email protected]>2016-10-27 22:28:24 -0700
commitccb5248205efb8176aeb845b69a3e9c414e0dc69 (patch)
treeb3bb10e8f13945afe3534945ceed3496e0a4ec31
parent63a524b352c1974c3e4ba85c46569547cbe9bb64 (diff)
parent79628b30fce9da3877648942edb0a1034bb5f25a (diff)
downloadbootstrap-ccb5248205efb8176aeb845b69a3e9c414e0dc69.tar.xz
bootstrap-ccb5248205efb8176aeb845b69a3e9c414e0dc69.zip
Merge branch 'issue19217' of https://github.com/alberto/bootstrap into alberto-issue19217
-rw-r--r--scss/_variables.scss22
1 files changed, 16 insertions, 6 deletions
diff --git a/scss/_variables.scss b/scss/_variables.scss
index 4b5af26ad..1a68a1fbf 100644
--- a/scss/_variables.scss
+++ b/scss/_variables.scss
@@ -58,12 +58,12 @@
}
}
-/// Replace `$search` with `$replace` in `$string`
-/// @author Hugo Giraudel
-/// @param {String} $string - Initial string
-/// @param {String} $search - Substring to replace
-/// @param {String} $replace ('') - New value
-/// @return {String} - Updated string
+// Replace `$search` with `$replace` in `$string`
+// @author Hugo Giraudel
+// @param {String} $string - Initial string
+// @param {String} $search - Substring to replace
+// @param {String} $replace ('') - New value
+// @return {String} - Updated string
@function str-replace($string, $search, $replace: "") {
$index: str-index($string, $search);
@@ -74,6 +74,15 @@
@return $string;
}
+@mixin _assert-starts-at-zero($map) {
+ $values: map-values($map);
+ $first-value: nth($values, 1);
+ @if $first-value != 0 {
+ @warn "First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}.";
+ }
+}
+
+
// General variable structure
//
// Variable format should follow the `$component-modifier-state-property` order.
@@ -172,6 +181,7 @@ $grid-breakpoints: (
xl: 1200px
) !default;
@include _assert-ascending($grid-breakpoints, "$grid-breakpoints");
+@include _assert-starts-at-zero($grid-breakpoints);
// 7. Grid containers