#Card Mod not working?

1 messages · Page 1 of 1 (latest)

thorny quarry
#

I'm building some dashboards for my kids rooms and one of the blocks for the dashbaord is a card with a random joke. Its using https://github.com/LaggAt/ha-jokes to create a sensor. I have the following card

entity: sensor.random_joke
features_position: bottom
vertical: false
grid_options:
  columns: full
  rows: 2
card_mod:
  style: |
    ha-card {
      color: red;
    }

But the text is just staying normal white. I installed card mod via hacs and I have done the instructions of adding to the configuration .yaml I forced reset the page etc and still nothing. Anyone else have an issue doing this? Am I using the wrong card type?

GitHub

Home Assistant Sensor providing a random joke every minute. - LaggAt/ha-jokes

tender solar
#

ha-jokes is an integration which is what gives you the (joke) sensor entity. the card_mod needed would be specific to the Tile card itself. (Meaning the ha-joke is not the problem; the card_mod syntax for the Tile card is the problem.)
I inspected a Tile card and found some properties to modify. (There are better resources/examples in the forum.) This is what I came up with (just playing around): yaml type: tile entity: sensor.random_joke features_position: bottom vertical: false grid_options: columns: full rows: 2 card_mod: style: | ha-card { --tile-color: red !important; --primary-text-color: black; --ha-card-background: lightgray; font-family: arial !important; height: 100px !important; border-width: 3px; border-style: dashed; border-color: red; } EDIT: I forgot you wanted red text but I used black. --primary-text-color can change that.

#

Two problems I ran into: I couldn't change the font size and I could not get it to better handle overflowing text like shown in the screenshot above.

#

Consider using the Markdown card instead. This card might give you some more flexibility. You can use inline code and/or card_mod to handle its design. ```yaml
type: markdown
content: "<center><font size=6 color='red'>{{ states('sensor.random_joke') }}"
card_mod:
style: |
ha-card {
background-color: transparent;
border: none;
}