Optimize custom style settings #1081
Unanswered
Matssa56
asked this question in
Questions about config, custom styles and templates
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Goal
Hi, I'm customizing some button cards in order to change the colors if an entity is on, off, unavailable, etc... Currently it works, however I need to copy my settings on a lot of buttons.
Is there a way to centralize these settings somewhere (for example in the theme, macro, CSS anchor, CSS class, etc?) in order to call the same settings everywhere I need (and therefore create other settings)?
For example I currently have three "settings" : entity on (put the card in green and icon in green), entity off (changed the global CSS value), alarm buttons (icon and color in red if a door is open and put some anymation in there with icon shadow is an entity is unavailable).
I wanted to use the .is-on or stuff like that since I want to avoid checking the state of the entity for easy stuff (less load maybe on the server?).
Thanks!
Source Yaml
Which step did you already try?
No response
Problem
No response
Read the documentation
Beta Was this translation helpful? Give feedback.
All reactions