From: Mark Otto Date: Fri, 28 Oct 2016 05:28:24 +0000 (-0700) Subject: Merge branch 'issue19217' of https://github.com/alberto/bootstrap into alberto-issue19217 X-Git-Tag: v4.0.0-alpha.6~471 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ccb5248205efb8176aeb845b69a3e9c414e0dc69;p=thirdparty%2Fbootstrap.git Merge branch 'issue19217' of https://github.com/alberto/bootstrap into alberto-issue19217 --- ccb5248205efb8176aeb845b69a3e9c414e0dc69 diff --cc scss/_variables.scss index 4b5af26ad0,8e9bd61284..1a68a1fbf1 --- a/scss/_variables.scss +++ b/scss/_variables.scss @@@ -58,22 -29,14 +58,31 @@@ } } - /// 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); + + @if $index { + @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace); + } + + @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,9 -134,10 +181,10 @@@ $grid-breakpoints: xl: 1200px ) !default; @include _assert-ascending($grid-breakpoints, "$grid-breakpoints"); + @include _assert-starts-at-zero($grid-breakpoints); -// Grid containers +// 7. Grid containers // // Define the maximum width of `.container` for different screen sizes.