Sass Map Functions
In Sass, the map data type represents one or more key/value pairs.
Tip: It is also possible to use the List functions from the previous page, with maps. Then the map will be treated as a list with two elements.
Sass maps are immutable (they cannot change). So, the map functions that return a map, will return a new map, and not change the original map.
The following table lists all map functions in Sass:
Function | Description & Example |
---|---|
map-get(map, key) | Returns the value for the specified key in the map.
Example: |
map-has-key(map, key) | Checks whether map has the specified key. Returns true or false.
Example: |
map-keys(map) | Returns a list of all keys in map.
Example: |
map-merge(map1, map2) | Appends map2 to the end of map1.
Example: |
map-remove(map, keys…) | Removes the specified keys from map.
Example: |
map-values(map) | Returns a list of all values in map.
Example: |