Canvas-gauge-card background: how-to

A very quick note in case this helps anyone else: I have been using the canvas-gauge-card in my setup, but sometimes all I really want to do is display a gauge on a regular card background.
Turns out, since the gauge card itself is transparent (which is nice) there is no background being rendered.

Here is my workaround:

              - type: custom:mod-card
                style: |
                    ha-card {
                      background-color: var(--secondary-background-color);
                      padding: 8px 0px 8px 0px;
                    }
                card:
                  type: custom:canvas-gauge-card
                  entity: sensor.snf_2_watts
...

That is all.

2 Likes

You solved a problem four years in the future for a stranger – brilliantly simple, thanks :vulcan_salute:t3: