Clooos / Bubble-Card

Bubble Card is a minimalist card collection for Home Assistant with a nice pop-up touch.
MIT License
1.81k stars 52 forks source link

New Popup approach disables card-mod-theme #395

Closed hellomarb closed 5 months ago

hellomarb commented 7 months ago

I don't think it can be fixed, but perhaps it has to be added to the documentation: if you are using a card-mod-theme in your theme like

card-mod-card: |
    .type-tile {
      background: red !important;
    }

it won't work anymore if a card is placed in a popup.

If you add it inside the card like

card_mod:
    style: |
      .type-tile {
        background: red !important;
      }

it still works without problems.

So global styles in your theme will break, specific customizations still work. Even cards rendered by auto_entities or decluttered_card get their custom styles applied, because they are rendered different.

That should added to the documentation, took me some time to realize what was the problem.

Clooos commented 7 months ago

Thanks for the info! I'm not sure that it can be fixed on my side but I will take a look at that.

hellomarb commented 7 months ago

I think the mechanic of recreating the cards on popup open breaks that initial load of card_mod and I don't know if there is a callback to trigger that again. Quickfix would be adding it to the readme, best fix would a real fix.

I moved that elements code already into the card again, most of them are auto_entities or decluttered_cards, so not a big deal to do it for some buttons and tiles.

Clooos commented 7 months ago

I've changed something related to that new approach, there was an other issue with it. It's even faster (again) now!

I can't say for sure but maybe that it will fix that issue 🤞

Edit: I've tried and it's fixed that way!

Edit 2: Just to be sure could you try this build? bubble-card.js.zip

Clooos commented 7 months ago

The new update is available!

hellomarb commented 7 months ago

I've tested it and for me it is not working :(

card-mod-card: |
    .type-tile {
      background: red !important;
    }

That is my test case in my custom theme and it is not working. I even tested the file you posted here, same result.

Add a tile card on the dashboard and in a popup card, then you see it directly with the card_mod theme.

Clooos commented 5 months ago

Hi, can you tell me if this issue still happens in the v2 beta?

Here is the link to the full changelog: https://github.com/Clooos/Bubble-Card/releases/tag/v2.0.0-beta.1

hellomarb commented 5 months ago

It is working again as expected, so it is finally fixed with the new approach 🍻