map.remove-type()

The map.remove-type() function removes the properties from $map where values are of $types.

// Sass.
@use 'sass:list';
@use 'sass:map';

// The `map.remove-type()` function.
@function remove-type($map, $types...) {
  @each $type in $types {
    @if list.index(
      number string color list map calculation bool null function,
      $type
    )
    {
      @each $key, $value in $map {
        @if type-of($value) ==
          $type or
          (not $type and type-of($type) == type-of($value))
        {
          $map: map.remove($map, $key);
        }
      }
    }
  }
  @return $map;
}

Parameters

$map

A map from which the values of type from $types are removed.

$types...

The types of values in $map to remove .

Return

The return value is a copy of $map without the values associated with $types.

Examples

// Use.
@use '@angular-package/sass/map';

// Examples.

Last updated