1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-28 07:39:57 +02:00

Helpers & utilities split (#28445)

This commit is contained in:
Martijn Cuppens
2019-05-23 11:56:03 +02:00
committed by GitHub
parent a4a04cd9ec
commit 769c8d8246
40 changed files with 957 additions and 449 deletions

View File

@@ -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.
//