Sass map-get() Function

Last Updated:

Sass map-get() Function

The map-get() function returns the value in a map associated with a key.

Example

SASS TO CSS CONVERTER
//Check your console $font-weights: ("regular": 400, "medium": 500, "bold": 700); @debug map-get($font-weights, "medium"); // 500 @debug map-get($font-weights, "extra-bold"); // null

Syntax

map-get($map, $key)

Parameter Value

ValueTypeExplanation
$map Required Specifies an array.
$key Required Specifies a key in an array.

Return Value

ValueExplanation
value Returns the value in $map associated with $key.

Share this Page

Meet the Author