thomasloven / lovelace-card-mod

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

HA Editor looses card-mod code #157

Closed ildar170975 closed 2 years ago

ildar170975 commented 2 years ago

My Home Assistant version: 2021.11.2

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

Steps to reproduce:

  1. Create a new card via UI, copy/paste this code into Editor:

    type: glance
    entities:
    - entity: sun.sun
    - entity: sun.sun
    icon: mdi:fan
    card_mod:
      style: |
        state-badge {
          color: orange;
        }
  2. The screen is: image

  3. Save the code, the screen is: image

  4. Open the Editor again, the screen is: image

The card_mod code is not displayed. If you press the “Save” button, the code will probably be saved w/o card_mod.

Error messages from the browser console: none


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

ildar170975 commented 2 years ago

This trick fixed the issue: https://community.home-assistant.io/t/card-mod-add-css-styles-to-any-lovelace-card/120744/2293?u=ildar_gabdullin

Now the card-mod code is visible in the Editor: image