Skip to content

Conversation

dcapslock
Copy link
Collaborator

@dcapslock dcapslock commented Sep 2, 2025

BREAKING CHANGE: Card background color will always be var (--card-background-color) when state is inactive and color_type: card. You can set card background with state.

Fixes #754

…olour_type: card` and `color` set.

BREAKING: Card background color will always be `var (--card-background-color)` when state is inactive and `color_type: card` and main `color` is set. You can set card background with state.
@dcapslock
Copy link
Collaborator Author

I hope I have done the commit message correct with BREAKING.

@RomRider
Copy link
Collaborator

RomRider commented Sep 15, 2025

I'm not sure I agree with this change. The idea of the color_type: card is to invert the logic.
If color_type is undefined, the logic applies to the icon (inactive is using css variables to match the inactive color of the domain). We should do the same here.

The problem is only when color_type: card is set and color is set at the same time, in that case, the background doesn't behave correctly it should follow the same logic as the icon if color_type is unset, but it keeps using --card-background-color instead of using the domain state color. This is what should be fixed, not forcing the background to be --card-background-color all the time

@RomRider
Copy link
Collaborator

Well, actually, if I look at the history, I fixed this in the past and forced the background to be the default card background color when off in this commit 41dea3f... So it seems it some people already complained about that haha 😄 but it wasn't complete.
So your fix is aligned with that logic

@RomRider RomRider merged commit b4f00f9 into custom-cards:dev Sep 15, 2025
3 checks passed
@dcapslock dcapslock deleted the color-type-card branch September 16, 2025 01:30
github-actions bot pushed a commit that referenced this pull request Sep 16, 2025
## [5.0.0-dev.1](v4.3.0...v5.0.0-dev.1) (2025-09-16)

### ⚠ BREAKING CHANGES

* **color:** Card background color will always be `var
(--card-background-color)` when state is inactive and `color_type:
card`. You can set card background with state.

### Features

* Add `icon_*_action` support ([#984](#984)) ([4e02887](4e02887)), closes [#739](#739)
* Support update timer ([#981](#981)) ([4717feb](4717feb)), closes [#436](#436)

### Bug Fixes

* **color:** inactive card background no longer inactive color when `colour_type: card` and `color` set. ([#987](#987)) ([b4f00f9](b4f00f9)), closes [#754](#754)
* Embedded light card handle issue ([#989](#989)) ([d01ef37](d01ef37)), closes [#427](#427) [#901](#901)
* Hold action on picture entity ([#996](#996)) ([9f2501f](9f2501f)), closes [#994](#994)
* Move while hold on touch devices ([#993](#993)) ([2c17386](2c17386))
Copy link

🎉 This PR is included in version 5.0.0-dev.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

dcapslock pushed a commit to dcapslock/button-card that referenced this pull request Sep 17, 2025
## [5.0.0-dev.1](custom-cards/button-card@v4.3.0...v5.0.0-dev.1) (2025-09-16)

### ⚠ BREAKING CHANGES

* **color:** Card background color will always be `var
(--card-background-color)` when state is inactive and `color_type:
card`. You can set card background with state.

### Features

* Add `icon_*_action` support ([custom-cards#984](custom-cards#984)) ([4e02887](custom-cards@4e02887)), closes [custom-cards#739](custom-cards#739)
* Support update timer ([custom-cards#981](custom-cards#981)) ([4717feb](custom-cards@4717feb)), closes [custom-cards#436](custom-cards#436)

### Bug Fixes

* **color:** inactive card background no longer inactive color when `colour_type: card` and `color` set. ([custom-cards#987](custom-cards#987)) ([b4f00f9](custom-cards@b4f00f9)), closes [custom-cards#754](custom-cards#754)
* Embedded light card handle issue ([custom-cards#989](custom-cards#989)) ([d01ef37](custom-cards@d01ef37)), closes [custom-cards#427](custom-cards#427) [custom-cards#901](custom-cards#901)
* Hold action on picture entity ([custom-cards#996](custom-cards#996)) ([9f2501f](custom-cards@9f2501f)), closes [custom-cards#994](custom-cards#994)
* Move while hold on touch devices ([custom-cards#993](custom-cards#993)) ([2c17386](custom-cards@2c17386))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants