aboutsummaryrefslogtreecommitdiff
path: root/scss/_functions.scss
diff options
context:
space:
mode:
authorMartijn Cuppens <[email protected]>2019-05-23 11:56:03 +0200
committerGitHub <[email protected]>2019-05-23 11:56:03 +0200
commit769c8d824600fbf521e3976cc4a3c6152ed4e8ce (patch)
tree270b5b5a1590e774f02a0baad9b5e66a1922b64e /scss/_functions.scss
parenta4a04cd9ec741050390746f8056cc79a9c04c8df (diff)
downloadbootstrap-769c8d824600fbf521e3976cc4a3c6152ed4e8ce.tar.xz
bootstrap-769c8d824600fbf521e3976cc4a3c6152ed4e8ce.zip
Helpers & utilities split (#28445)
Diffstat (limited to 'scss/_functions.scss')
-rw-r--r--scss/_functions.scss24
1 files changed, 24 insertions, 0 deletions
diff --git a/scss/_functions.scss b/scss/_functions.scss
index e867b5521..096b15205 100644
--- a/scss/_functions.scss
+++ b/scss/_functions.scss
@@ -30,6 +30,30 @@
}
}
+// Internal Bootstrap function to turn maps into its negative variant.
+// If prefixes the keys with `n` and makes the value negative.
+@function negativify-map($map) {
+ $result: ();
+ @each $key, $value in $map {
+ @if $key != 0 {
+ $result: map-merge($result, ("n" + $key: (-$value)));
+ }
+ }
+ @return $result;
+}
+
+// Get multiple keys from a sass map
+@function map-get-multiple($map, $values) {
+ $result: ();
+ @each $key, $value in $map {
+ @if (index($values, $key) != null) {
+ $result: map-merge($result, ($key: $value));
+ }
+ }
+ @return $map;
+}
+
+
// Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms.
//