From ac96ecbec5440b67f5c6c587e4c39d06b1262e34 Mon Sep 17 00:00:00 2001 From: Mark Otto <markd.otto@gmail.com> Date: Tue, 13 Jun 2017 22:30:33 -0700 Subject: [PATCH] rearrange, add comments --- scss/_functions.scss | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/scss/_functions.scss b/scss/_functions.scss index 870df42a79..5aa9f66209 100644 --- a/scss/_functions.scss +++ b/scss/_functions.scss @@ -1,3 +1,9 @@ +// Bootstrap functions +// +// Utility mixins and functions for evalutating source code across our variables, maps, and mixins. + +// Ascending +// Used to evaluate Sass maps like our grid breakpoints. @mixin _assert-ascending($map, $map-name) { $prev-key: null; $prev-num: null; @@ -14,7 +20,19 @@ } } +// Starts at zero +// Another grid mixin that ensures the min-width of the lowest breakpoint starts at 0. +@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}."; + } +} + // Replace `$search` with `$replace` in `$string` +// Used on our SVG icon backgrounds for custom forms. +// // @author Hugo Giraudel // @param {String} $string - Initial string // @param {String} $search - Substring to replace @@ -29,11 +47,3 @@ @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}."; - } -} -- GitLab