DEV Community

Discussion on: Using SCSS maps as object - is it good?

Collapse
vicvicvic profile image
Victor F

And now the next step: convert these into functions:

@function fontsize($key) {
@if not map-has-key($fontSizes, $key) {
@warn "Color `#{$key}` not found.";
}
@return map-get($fontSizes, $key);
}

Collapse
nicolalc profile image
Nicola Author

That's pretty cool, I think I'll implement in my projects! Thanks a lot!