Color function optimization
@acburst and @Dogfalo can you please look into it?
You got rid of our warning for an incorrect color input. Have you tested input errors?
Given that the colors are highly based on Google's color pallet the chance of 'new' and or 'changed' colors are low. But, if you feel cautious it can be added. Warnings are easy to avoid as long as you know what you're doing.
It helps people debug if they have a typo in the color function
Warning added back as a precaution
Warning added back, code is safe.
That part of the code will never be executed? That was why we checked beforehand if the key existed so we could correctly return null with a warning. Right now it will only return null.
If there's a typo, it'll give a warning. The warning is as you originally typed it. Code runs fine. Same functionality.
I've just tested this with 3 cases:
Which results in a compilation error.
Which compiles, but does not raise the warning (which it should).
Hm. I'll fix it
Warning didn't work because I forgot to add the parent @if map-has-key($colors, $color)
@if map-has-key($colors, $color)
@acburst @Dogfalo Please look into it and do the needful