thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.12k stars 167 forks source link

card-mod-themes: "class" is not set for a row #172

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

My Home Assistant version: 2021.12.7

My lovelace configuration method (GUI or yaml): yaml/GUI

What I am doing: Trying to use these method: https://github.com/thomasloven/lovelace-card-mod/wiki/Card-mod-Themes#classes

  1. Specified a theme for rows of some class.
  2. Set this class for some row.

What I expected to happen: The style is applied to the row.

What happened instead: The style is NOT applied to the row. изображение

Minimal steps to reproduce:

  card-mod-row: |
    :host(.class-row-red) {
      color: red;
      --paper-item-icon-color: red;
    }
  - type: entities
    entities:
      - entity: input_number.test_number
        class: class-row-red

What I see in Code Inspector: изображение

If I set the class manually: изображение then the style is applied: изображение

Error messages from the browser console: none

By putting an X in the boxes ([]) below, I indicate that I:

ildar170975 commented 2 years ago

Got it working!

  - type: entities
    entities:
      - entity: input_number.test_number
        card_mod:
          class: class-row-cyan

Use the class under the card_mod keyword.