Open diwu1989 opened 10 years ago
The getColor function still returns hex values for the color. If you instead returned css class names like progress-yellow, progress-green, progress-red, you can keep the hex in the CSS.
Hi Di, I actually had it using classes before, but I wanted to be able to tween the colors. I couldn't see a way to tween the two classes.
In the old days of ghetto CSS, you wouldn't be able to transition the color, but with CSS3 being supported in all modern browsers nowadays, you can push that tweening over to the CSS engine.
The directive right now has hardcoded styles for color, text size, etc...
For better separation of concern and ease of use by designers, it's better to name elements with different css classes and then define the style for those classes in the css file.
It also makes it easier for people to re-use the directive in different places and re-skin it via CSS, vs being tied to one color scheme.