Web Developer

SASS Section 7 – Maps

  • map structure:
    • $mapName : (‘key’: ‘value’, ‘key1’: ‘value1’, nestedMap: (‘subMapKey’: ‘subMapValue’, ‘subMapKey1’: ‘subMapValue1’, …), …)
  • map function:
    • map-keys(mapVariable), return map’s key
    • map-values(mapVariable), return map’s value
    • map-has-key(mapVariable, valueWant), return a boolean
    • map-get(mapVariable, mapKeyName), return the key’s value
    • map-merge(mapVariable1, mapVariable2) return a merged map
    • map-remove(mapVariable, mapKeyName1, mapKeyName2, …) return map without the removed value
    • inspect() to check the map content, such as inspect(map-merge(mapVariable1, mapVariable2) || map-remove(mapVariable, mapKeyName1, mapKeyName2, …));