lovelace-card-mod: 2024.8 style badge styling doesn't work
My Home Assistant version: 2024.8
My lovelace configuration method (GUI or yaml): GUI
What I am doing: using card mod in theme to style badges
What I expected to happen: style badges đ
What happened instead: nothing
Minimal steps to reproduce: try anything in card-mod-badge-yaml:
card-mod-badge-yaml: |
.badge {
padding: 2px 8px !important;
border-radius: 0px !important;
}
Doesnât get attached to badge shadow root at all
Error messages from the browser console:
VM13847:1 Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
at JSON.parse (<anonymous>)
at s.<anonymous> (card-mod.js:1:48199)
at d (card-mod.js:1:2813)
at Generator.<anonymous> (card-mod.js:1:4159)
at Generator.next (card-mod.js:1:3242)
at y (card-mod.js:1:8728)
at a (card-mod.js:1:8931)
at card-mod.js:1:8990
at new Promise (<anonymous>)
at s.<anonymous> (card-mod.js:1:8871)
Not sure if the error is relevant but I included it anyways.
By putting an X in the boxes ([]) below, I indicate that I:
-
Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).
-
Have made sure I am using the latest version of the plugin.
-
Have followed the troubleshooting steps of the âCommon Problemsâ section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.
-
Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 6
- Comments: 18 (3 by maintainers)
this is a full example of how card_mod (and its companion mod-card) are needed to style the new badges:
or one using state-colors:
itâs is not a bug as explained above, but a new element, and we needed to find the optimal way to touch all elements in the badge.
with that you should close the current issue, since the styling does work correctly, and if you require more, hop over to the community for support
@AdmiralStipe It is NORMAL to be inexperienced in smth. Suggest you to do 2 things: â wait - may be someone in Community will post smth useful â learn - on simple examples, check the link I provided (man, I never ever ever dealt with CSS, learned from zero - and issued tutorials, one by one - learned again - improved tutorials - and so on)
As for ânobody solved yetâ - possible reasons are: â badges are not commonly used â people are consumers, not creators
yeah, I am still crossing my fingers Thomas can reintroduce the 3.5.0 features at some point. As a matter of fact, I never upgraded to 3.4.4 and still use 3.5.0 and all of its features. (mainly the removal of mod-card has simplified things a lot)
only thing that doesnt work anymore is card-mod settings to auto-entities cards, so I rewrote those configs.
cut it short: I do hope a future version brings back the features of 3.5.0, and at the same time would introduce support for the new
hui-view-header, see https://community.home-assistant.io/t/card-mod-super-charge-your-themes/212176/1977?u=mariusthvdbYes, I do somthing similar but I still reported this since the badge itself is exposed to card-mod theming.
same issue