map.remove()
The map.remove() function with unified map.remove() and deep-remove() returns $map without $keys.
// Sass.
@use 'sass:list';
@use 'sass:map';
@use 'sass:meta';
// The `map.remove()` function.
@function remove($map, $keys...) {
@each $key in $keys {
$map: if(
meta.type-of($key) == list and list.separator($key) == comma,
map.deep-remove($map, $key...),
map.remove($map, $key)
);
}
@return $map;
}https://github.com/angular-package/sass/blob/main/map/_map.remove.function.scss
Parameters
$map
$mapA map to remove $keys from.
$keys...
$keys...Multiple keys to remove from $map. If key is a comma-separated list then map.deep-remove() function is used, otherwise map.remove().
Return
The return value is a copy of $map without any values associated with $keys.
Examples
Last updated
Was this helpful?