thomasloven / lovelace-card-mod

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

Problem in Android / iOS app #167

Closed altapo closed 2 years ago

altapo commented 2 years ago

My Home Assistant version: core-2021.12.1

My lovelace configuration method (GUI or yaml): yaml

What I am doing: In Android / iOS app the styles in the example do not work

What I expected to happen (works in browser): photo_2021-12-15_12-12-52

What happened instead (doesn't work in Android / iOS app): photo_2021-12-15_12-05-12

Minimal steps to reproduce:

type: entities
entities:
  - type: custom:multiple-entity-row
    entity: group.light_room
    name: Room
    icon: mdi:sofa-outline
    secondary_info:
      entity: group.light_room
      name: false
    state_color: true
    show_state: false
    card_mod:
      style:
        hui-generic-entity-row$:
          .: |
            :host {
              flex-wrap: wrap;
            }
            state-badge {
              line-height: 30px;
              break-after: always;
            }
            .info {
              margin-left: 0;
            }
          state-badge$:
            ha-state-icon$:
              ha-icon$: |
                ha-svg-icon {
                  width: 30px;
                  height: 30px;
                }

Error messages from the browser console: no


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

altapo commented 2 years ago

Problem solved

card_mod:
  style:
    hui-generic-entity-row$:
      .: |
        :host {
          flex-wrap: wrap;
        }
        state-badge {
            min-width: 100%; <--- ADD
            text-align: left; <--- ADD
            line-height: 30px;
            break-after: always;
        }
        .info {
          margin-left: 0 !important; <--- ADD IMPORTANT
        }
      state-badge$:
        ha-state-icon$:
          ha-icon$: |
            ha-svg-icon {
              width: 30px;
              height: 30px;
            }