Skip to content

card-mod background-color briefly flashes then disappears when using mushroom cards inside stack-in-cardย #75

@mjkvaak

Description

@mjkvaak

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
0.2.0

Browser and Operating System:

$ lsb_release -a
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy

$ google-chrome --version
Google Chrome 145.0.7632.109

Description of problem:

When using card-mod to style a custom:mushroom-template-card inside custom:stack-in-card, the style is applied only momentarily and then disappears.

The background color briefly flashes during rendering but becomes transparent immediately after.

The same configuration works correctly when the card is not wrapped in stack-in-card.

Additional information:

Minimal reproducible example

# This does NOT work
type: custom:stack-in-card
cards:
  - type: custom:mushroom-template-card
    primary: "Hello!"
    card_mod:
      style: |
        ha-card {
          background-color: #002f7a;
        }
# This works correctly
type: custom:mushroom-template-card
primary: "Hello!"
card_mod:
  style: |
    ha-card {
      background-color: #002f7a;
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions