Card-mod selector syntax

Newbie question here. I am trying to style a card-mod. The code below works for my card, changing the color of all text inside:

card_mod:
style: |
   :host {
      color: yellow;
   }

But I want to be more specific, like this (doesn’t work):

card_mod:
style: |
   .myClassName {
      color: yellow;
   }
   h1 { ... }
   h1.anotherClassName { ... }

What am I missing? I read the docs and tried some variations of “$” and so, without success. I didn’t understand.

Thank you.

Search the card-mod thread and take the link to the great examples in the first post from Ildar.

1 Like