thomasloven / lovelace-card-mod

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

Unexpected indentation when adding secondary_info to modded entity #288

Closed MaxVonEvil closed 11 months ago

MaxVonEvil commented 11 months ago

My Home Assistant version: 2023.7.2 Supervisor 2023.07.1 Operating System 10.3 Frontend 20230705.1 - latest

My lovelace configuration method (GUI or yaml): Yaml

What I am doing: Adding "secondary_info: last-changed" to an entity after having added mods to remove icon and set left margin to 0.

What I expected to happen: Text supposed to stay where it was at margin 0

What happened instead: Text indented half way in. See screenshot:

image

Minimal steps to reproduce: Try pasting my Yaml code below into a new manual card and see if it does the same. Just add/remove the secondary_info line and see how it changes the indentation.

# The least amount of code possible to reproduce my error

square: false
type: grid
cards:
  - type: entities
    entities:
      - entity: switch.valve_irr_zone1
        name: Z1 Back lawn E
        secondary_info: last-changed
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .text-content {
                  margin-left:0 !important;
                }
      - entity: switch.valve_irr_zone2
        name: Z2 Back lawn W
        secondary_info: last-changed
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .text-content {
                  margin-left:0 !important;
                }
      - entity: switch.valve_irr_zone3
        name: Z3 Front drips
        secondary_info: last-changed
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .text-content {
                  margin-left:0 !important;
                }
      - entity: switch.valve_irr_zone4
        name: Front lawn W
        secondary_info: last-changed
        card_mod:
          style:
            hui-generic-entity-row:
              $: |
                state-badge {
                  display: none;
                }
                .text-content {
                  margin-left:0 !important;
                }
  - type: entities
    entities:
      - sensor.sw_visual_studio_code_version
      - sensor.sw_visual_studio_code_newest_version
      - sensor.sw_samba_share_version
columns: 2

# End of code

Error messages from the browser console: None


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

MaxVonEvil commented 11 months ago

Closing this issue as a solution was kindly provided provided in the HA forums here: https://community.home-assistant.io/t/entities-card-without-icon/165394/6