Skip to content

show_icon: true stops working when any styles: , extra_styles or card_mod is added #1179

@WitteKraai

Description

@WitteKraai

Checklist

  • [ X] I updated the card to the latest version available
  • [X ] I cleared the cache of my browser

Describe the bug
When using show_icon: true alone, the icon renders correctly. However, as soon as any styling is added (via styles:, extra_styles, or card_mod), the icon disappears completely regardless of what styles are defined. Even a single harmless style like height: 50px on the card breaks the icon.

Version of the card
Version: v7.0.1

Home Assistant version:
core-2026.5.3

To Reproduce
This is the configuration I used:

Works (icon visible):

type: custom:button-card
entity: light.my_light
icon: mdi:chandelier
show_icon: true

Broken (icon invisible):

type: custom:button-card
entity: light.my_light
icon: mdi:chandelier
show_icon: true
styles:
  card:
    - height: 50px

Screenshots
N/A

Expected behavior
An icon that is showed and the possibilities to make styling for the button and/or icon with styles: extra_styles and/or card-mod.

Desktop (please complete the following information):

  • Browser: Microsoft Edge (also reproduced on Android)
  • card-mod version: v4.2.1
  • Frosted Glass theme installed (but issue reproduces with default theme too)
    -Tested on clean dashboard with no other cards

Smartphone (please complete the following information):

  • Device: Android (Samsung)
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Beeing working on builing a nice setup for my lamps with help from Claude, but even Claude was unable to make some styling and a visible icon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions