JavaScript templates anywhere?

I’m using the custome button card that lets me use JavaScript templates inside [[[ and ]]]. Does the card itself need to support that or is that something I can do anywhere in any card?

Unfortunately, it is the only way I can change icon colors on my older devices that run iOS 10 (iPad 4).

If a card doesn’t support it, would it be easy to modify so that it does or would that require a complete re-work of the custom card?