Apply styles to elements and cards
masterWhen using config-template-card inside a picture-elements card or as a wrapper:
- The
styleobject inside theelementconfiguration is applied to the element itself. - The
styleobject inside theconfig-template-cardconfiguration is applied to the surrounding card.
Note: For picture-elements elements, you must configure top and left attributes on the config-template-card to position it correctly.
type: picture-elements
image: http://example.com/image.jpg
elements:
- type: 'custom:config-template-card'
variables:
- states['light.bed_light'].state
entities:
- light.bed_light
element:
type: icon
icon: "${vars[0] === 'on' ? 'mdi:home' : 'mdi:circle'}"
style:
'--paper-item-icon-color': '${ states['sensor.light_icon_color'].state }'
style:
top: 47%
left: 75%