map.values($map) returns a comma-separated list of all values in $map, in map order. Load it with @use "sass:map" on Dart Sass 1.23+. Legacy global name: map-values.
Returns every value as a comma-separated list in map order.
Top-level only — nest with map.get first for deeper values.
Great with @each when you only need the data.
Prefer map.values over deprecated global map-values.
One line: when you need the data in a map, call map.values($map).
Practice
Compile Notes
Practical checklist:
checklist.txt
1. @use "sass:map"
2. Use map.values for data; map.keys for names
3. Nested values: map.values(map.get($map, $group))
4. Loop: @each $v in map.values($m) { ... }
5. Avoid global map-values in new code
Frequently Asked Questions
map.values($map) returns a comma-separated list of all values in the map, in the same order as the map’s keys. It does not flatten nested maps—nested map values appear as map items in the list.
map.keys returns the names (keys). map.values returns the stored values in the same order. Use keys when you need names; use values when you only need the numbers, colors, or other data.
Yes. map-values($map) is the older global name, but Dart Sass deprecates global built-ins toward Sass 3.0. Prefer map.values after @use "sass:map".
No automatic deep flatten. map.values only lists values of the map you pass. To list values inside a nested map, first get that nested map: map.values(map.get($theme, colors)).
map.values(()) returns an empty list (). list.length of that list is 0.
Use @each $value in map.values($map) { ... }. If you also need the key name, prefer @each $key, $value in $map or loop map.keys and call map.get.