$count: 0; @function counter() { $count: $count + 1 !global; @return $count; } $map: ( counter(): 'bar', counter(): 'foo', ); .foo { content: inspect($map); }