Adding a string/digit with the map-get output sass

Viewed 56

I am trying to add a value let say 90 with the map-get output.

I tried simply adding 90 as a string, let say the map-get output is white color,#ffffff.

color: map-get(map-get($valuemap, $key), color)+"90";

Dart sass compiles it as invalid property, "#ffffff90"

How can I get from "#fff90" to #fff90?

1 Answers

Turns out you can simply get the value inside quotes "" with #{} in sass.

Changed this

color: map-get(map-get($valuemap, $key), color)+"90";

To

color: map-get(map-get($valuemap, $key), color)+#{"90"};

Dart sass will compile #ffffff + #{"90"} into a valid output, #ffffff90

Related