Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Icon color change beta 2.5.0-beta.6 #1266

Open
Claeysjens opened this issue Feb 20, 2025 · 12 comments
Open

Icon color change beta 2.5.0-beta.6 #1266

Claeysjens opened this issue Feb 20, 2025 · 12 comments
Labels
bug Something isn't working

Comments

@Claeysjens
Copy link

Claeysjens commented Feb 20, 2025

Describe the bug
Icon color change

Screenshots
image
image

  • Bubble Card version: [2.5.0-Beta 6]

Hey, the new beta has changed some of the icon colors on my dashboard.
If I roll back to Beta 5, the icon colors will return to normal.

Thank you!

@Claeysjens Claeysjens added the bug Something isn't working label Feb 20, 2025
@Claeysjens Claeysjens changed the title H Icon color change beta 2.5.0-beta.6 Feb 20, 2025
@Clooos
Copy link
Owner

Clooos commented Feb 20, 2025

Hi, do you have some custom styles applied to these cards?

@Claeysjens
Copy link
Author

Claeysjens commented Feb 20, 2025

Hi, do you have some custom styles applied to these cards?

Hello,

See below the custom style for the kitchen as an example.

styles: >-

.bubble-sub-button-1 > ha-icon {
color: ${hass.states['media_player.luidspreker_keuken'].state === 'playing' ? 'dodgerblue' : 'grey'} !important;
}

.bubble-sub-button-2 > ha-icon {
color: deepskyblue !important;
}

.bubble-sub-button-3 {
animation: ${parseFloat(hass.states['sensor.keuken_airflow_ventilation_rate'].state) > 10.0 ? 'slow-rotate 2s linear infinite' : 'none'};
}

.bubble-sub-button-3 > ha-icon {
color: mediumseagreen !important;
}

@Keyframes slow-rotate {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}

${card.querySelector('.bubble-state').innerText =
parseFloat(hass.states['sensor.temperatuur_beneden'].state).toFixed(1) +
"°C"};

.bubble-icon-container::after {
border-radius: 100%;
}

.bubble-icon-container {
overflow: visible !important;
}

.bubble-entity-picture {
border-radius: var(--bubble-icon-border-radius, var(--bubble-border-radius, 50%));
}

// Edited, content from Patreon.

@Clooos
Copy link
Owner

Clooos commented Feb 20, 2025

Well, I don't see anything that modify the main icon, but this lines were misplaced, adding these in the middle of your styles was probably blocking the code below it, in v2.4.0 only. In v2.5.0 these templates can be placed anywhere, so this is the normal behavior of your custom styles. Remove everything and start fresh to see where the issue is.

${card.querySelector('.bubble-state').innerText =
parseFloat(hass.states['sensor.temperatuur_beneden'].state).toFixed(1) +
"°C"};

@Claeysjens
Copy link
Author

Claeysjens commented Feb 20, 2025

Well, I don't see anything that modify the main icon, but this lines were misplaced, adding these in the middle of your styles was probably blocking the code below it, in v2.4.0 only. In v2.5.0 these templates can be placed anywhere, so this is the normal behavior of your custom styles. Remove everything and start fresh to see where the issue is.

${card.querySelector('.bubble-state').innerText =
parseFloat(hass.states['sensor.temperatuur_beneden'].state).toFixed(1) +
"°C"};

Thank you for your response. I cleared the entire custom styles, but the icon still looks different than expected. However, I now see that when the lighting is on, the icons I thought were correct are actually the wrong ones. They appear to be dimmed.
In the meantime, I see that there is already a Beta 7, but the problem persists.

image

@Claeysjens
Copy link
Author

Well, I don't see anything that modify the main icon, but this lines were misplaced, adding these in the middle of your styles was probably blocking the code below it, in v2.4.0 only. In v2.5.0 these templates can be placed anywhere, so this is the normal behavior of your custom styles. Remove everything and start fresh to see where the issue is.
${card.querySelector('.bubble-state').innerText =
parseFloat(hass.states['sensor.temperatuur_beneden'].state).toFixed(1) +
"°C"};

Thank you for your response. I cleared the entire custom styles, but the icon still looks different than expected. However, I now see that when the lighting is on, the icons I thought were correct are actually the wrong ones. They appear to be dimmed. In the meantime, I see that there is already a Beta 7, but the problem persists.

image

Hello, I started completely over with one of the icons that was dimmed, and when adding a third sub-button, the icon jumps to a dimmed state. I tried this on a different card where I only had one sub-button, and with certain entities, the icon switches to a dimmed state.

It's working fine with this entity.

Image

But not with this one.

Image

Maybe this information can help you further?

@Clooos
Copy link
Owner

Clooos commented Feb 20, 2025

I will check that, thank you for the details!

@CZonin
Copy link

CZonin commented Feb 21, 2025

@Clooos Seeing the same issue on my end with beta.6 + beta.7.

Notice the icons for "Main Lights" and "Living Room". Previously all of the icons were grey when disabled like the "Main Lights" icon still is. After the update a lot of icons became brighter like "Living Room".

Image

@Paoloc66
Copy link

Paoloc66 commented Feb 22, 2025

I also have a similar problem of darkened icon.
I noticed that based on the type of entity inserted in the last sub button the main icon darkens or not.
Or even if the last entity is a light and it turns on then the main icon becomes less dark

@EnderSurge
Copy link

Can confirm I have the same issue on v2.5.0-beta.7

The only solution I’ve found is to add another sub button of an entity that is always enabled (in my case a climate entity), then add a visibility condition that is never true, so the sub button is always hidden. I use a blank entity state condition.

This could indicate that the main icon’s brightness is affected by a sub button entity’s state.

@Paoloc66
Copy link

in reality it is much simpler.
Just add another sub button but without associating any entity to it, and then obviously do not display the icon

@EnderSurge
Copy link

I’m not sure how to add a sub button without associating any entity, as it defaults to the card entity. Also, if I just hide the sub button icon and background, it is still there and can be tapped/clicked, just not visible.

In another case, I have a state bubble card pointing at the weather forecast which has a dimmed icon without adding any sub buttons. The only way to brighten the icon again is by adding an entity that is “on” e.g. climate entity

@Clooos
Copy link
Owner

Clooos commented Feb 24, 2025

This will be fixed in the next release, don't worry 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants