After reading through a suggested solution here
Conditional colors for fontawesome in Card List
I thought there might be a way to do this without creating a new template.
Note in my case I was using report, not list.
Using compact with no icons, I found the CSS had to refer to the :before selector as t-Icon seemed to get ignored/overwritten, even though it showed up in the DOM
.t-Cards .RAG-green .t-Card .t-Card-wrap:before {
background-color: #9bbb59;
}
Then I included the CSS in my dynamic SQL for the report
,'RAG-green' card_attributes
This worked and required minimal customisation. Any future updates to the template should not affect directly the result.
Can anyone see a problem with this solution? Or a way to improve it?
I'm still curious as to why we have a report and list cards template, and which one is easier.