#How to apply a theme to a specific card
1 messages · Page 1 of 1 (latest)
Best would be to use card_mod to change the elements you want to style. https://community.home-assistant.io/t/card-mod-add-css-styles-to-any-lovelace-card/120744/4143
This link is an even better source:
https://community.home-assistant.io/t/mushroom-cards-card-mod-styling-config-guide/600472
I am trying to figure out how to adjust the size of the light adjustment bars in the light card. I think I’m wasting space, so I would like to have the bar to extend to the left, like I mocked in the screenshot. (How) can I achieve that with card-mod? And, are there any good tutorials on how to get started with card-mod as a non-developer...
This topic is technically a cross post from a reply to the Mushroom Card Topic found here: Part 1. But it was suggested in a comment to post it here as a guide instead. Below info is true as of Mushroom Version 4.4.0 and Card Mod Version 3.4.4 (you can also optionally use a theme like i do. i use Minimalist Version 1.3.18). links to each pos...
I thought about that but I need it for about 120 cards so I'm looking for a more optimal option to avoid duplicates
Did you try yaml anchors?
card_mod:
style: &ref_anchor |
...
card_mod:
style: *ref_anchor
Another option would be to use card_mod in your theme.yaml. Look for "card-mod-card-yaml"... However, not sure if this works with mushroom cards.
Another option would be to use card_mod in your theme.yaml. Look for "card-mod-card-yaml"... However, not sure if this works with mushroom cards.
I briefly looked at this as an option but I don't know if it is possible to target the Mushroom Light Cards
Some other options to consider:
auto entities can output cards based on the entities you want show. card_mod can be incorporated into the cards
Decluttering card can be used to create templates to reduce the amount of repeatitive code. The concept is similar to YAML anchors like suggested above. The downside with this method: you'd still have to modify each of the cards
Converting your current UI-based dashboard to a YAML-based dashboard would be the easiest/quickest to be able to modify all of the cards. You'd be working with raw YAML and not be able to use the UI to edit the dashboard. Then, you could make a YAML anchor like coasting24 suggested and then copy/paste a single line into each Mushroom Light card.
Take a look at Adding more dashboards with YAML noting the code mentioned in You can also add YAML dashboards when your main dashboard is UI configured:. Using something like VSCode or your favorite text editor can be used. Just copy your raw dashboard code (Edit the dashboard > click the three dots in the top right > Raw configuration editor) into your text editor and save it based on the configuration you saved.