The energy-period-selector canāt be targeted by card-mod as itās a sibling of hui-root and not in hui-root shadow which is where card-mod is applied, meaning card-mod can only target hui-root itself (:host) and what is in shadowRoot.
A few workarounds I have tested:
Define ha-space-4 as your override in theme, also then setting back to standard for root, config, custom-panel and developer-tools via card-mod theme.
Set safe-area-inset-bottom though this will have other impacts.
Even though energy-period-selector uses ha-card, as it does not have āconfigā card-mod ignores it. v4.0.0 did not change this though hui-card patch will apply card-mod without config, so a possible card-mod improvement would be to do the same for ha-card allowing themes to target ha-card which has no config, like the case is here,
Oh the color change on the card itself when the scene is static looks pretty good - the issue I have is when selecting a new scene, the color change from one scene to the next is kinda janky on the bedroom card. It looks fine once the colors settle in.
The latest updates this week to custom:lovelace-multiline-text-input-card break the card-mod formatting. None of my styles work anymore. (We now have built-in options to change the number of lines in the textbox and to hide the card title, but my most important card-mod styles were to do with other parts of the card). Any ideas? Thanks in advance!
Update the card, read the updated Docs.
Hint - āprependā should be used in case of card-mod 4.x. Meanwhile, the card works fine with card-mod 3.x.
(have not checked your code in details)
Thanks for replying, though itās still not working on my end. Iām on card-mod v4.2.0-beta.6, multiline card 1.0.7, and Home Assistant core/OS 2026.1.0. ( I saw theyāre still working through some glitches on card-modās āissuesā page, which is why I eventually installed the beta.)
Iāve also cleared cache multiple times. I checked card-modās update notes but didnāt notice anything relevant aside from āprependā. I tried adding the link for card-modās extra_module_url in my config in case that would somehow help, but it didnāt
And itās a little difficult to interpret the multiline cardās update notes since they include vague comments like āImproved code, refactored a bit, some better error handlingā and āSmaller refactorings and improved codeā. Thereās at least one specific note that may be relevant ā āRemoved textarea margin-top and replaced the JS resizing by flex CSSā ā but Iām not sure.
I can open an issue on card-modās github if thatād be a better place for this. In the meantime, hereās my āprependā YAML:
Also, note that the card does have own ha-card - but it does not accept styles when not placed inside Entities card (at least in card-mod 4.x; could not test with 3.x, already shutdown a server). Perhaps this should be reported somewhere.
I checked out the cardās code and it rebuilds it config and does not store card_mod in config so when used as a plain card there is no config for card_mod to read. When used as a row in etities the row has the config for card_mod to read.
A workaround to use as card is to wrap with mod_card or customhui-element and then style via lovelace-multiline-text-input-card $ selector if using mod-card or direct style if using custom:hui-element where card-mod styling is transparent.
EDIT: 1.0.6 of lovelace-multiline-text-input-card removed storing all original config in _config to storing rebuilt config in config. So to now be compatible with card_mod it should store card_mod config in is config.
Like I said above, Iām actually happy with the linear gradient on a static scene - the area is small enough that the kind of jank that the blog author discusses isnāt really an issue. Itās when I switch colors on the bulbs that the card canāt decide what to do so it flips between two states until it settles and that can look SUPER janky when itās dramatic differences between scenes or long transition times (>10sec).
I donāt. card-mod is the first time Iāve looked at CSS in 20 years - itās gotten a fair bit more complicated.
EDIT: I was able to capture a short recording of this. These are 5 second transitions via the dashboard buttons I have for the scenes - I have tried longer, and the hesitation for the transition is greater but the initial ālurchā towards the end result is the same.
If I am understanding you correctly, its scene transition that is giving you ājankinessā. So I would assume that your template is getting some quick updates due to this, hence what you see as changes in the output.
To assist in seeing what is going on, you can add {# card_mod.debug #} to your template and you will see console logs when the template updates, and what the result is.
Thoughts on managing would be:
Use a helper which debounces your light colors so your card_mod template does not get so rapid updates.
Look to using CSS transition to assist with how the output responds to template updates. Not sure if this will help.