0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-11-29 11:24:18 +01:00

Utility API improvement: use $key/$value instead of nth (#28828)

Co-Authored-By: Martijn Cuppens <martijn.cuppens@gmail.com>
This commit is contained in:
Ashfahan Khan 2019-05-30 20:22:06 +05:00 committed by Martijn Cuppens
parent fd21354de2
commit 41fcd13d3e
2 changed files with 3 additions and 4 deletions

View File

@ -53,7 +53,6 @@
@return $map;
}
// Replace `$search` with `$replace` in `$string`
// Used on our SVG icon backgrounds for custom forms.
//

View File

@ -8,7 +8,7 @@
$values: zip($values, $values);
}
@each $value in $values {
@each $key, $value in $values {
$properties: map-get($utility, property);
// Multiple properties are possible, for example with vertical or horizontal margins or paddings
@ -21,12 +21,12 @@
$property-class: if($property-class, $property-class, nth($properties, 1));
// Don't prefix if value key is null (eg. with shadow class)
$property-class-modifier: if(nth($value, 1), "-" + nth($value, 1), "");
$property-class-modifier: if($key, "-" + $key, "");
.#{$property-class + $infix + $property-class-modifier} {
@each $property in $properties {
// stylelint-disable-next-line declaration-no-important
#{$property}: #{nth($value, 2)} !important;
#{$property}: $value !important;
}
}
}