in a node-red template node i would like to change the color of an icon to green when variable is true.
But it does not work.
What do I do wrong, please?
This tag is closed but never opened. This way your code doesn't populate an array of rows.
But anyway - the reason why it does not colorize icons is that the ui_template forces a rule to have svg path elements colored with the theme color. As your icons will be svg - the fill you trying to add will get lower specificity so it does not apply.
To make it working you'll need to make styles for every color you'll need.