Conditional elements - 2 options for styling:
type: vertical-stack
cards:
- type: entities
title: Conditional
entities:
- entity: input_boolean.test_boolean_2
name: show
- type: picture-elements
card_mod:
style:
hui-conditional-element hui-state-label-element:
$: |
div {
color: red;
}
.: |
ha-card {
height: 80px !important;
}
elements:
- type: state-label
entity: sensor.cleargrass_1_co2
style:
top: 6%
left: 10%
- type: conditional
conditions:
- entity: input_boolean.test_boolean_2
state: 'on'
elements:
- type: state-label
entity: sensor.cleargrass_1_co2
style:
top: 6%
left: 30%
image: /local/images/white.jpg
- type: picture-elements
card_mod:
style: |
ha-card {
height: 80px !important;
}
elements:
- type: state-label
entity: sensor.cleargrass_1_co2
style:
top: 6%
left: 10%
- type: conditional
conditions:
- entity: input_boolean.test_boolean_2
state: 'on'
elements:
- type: state-label
entity: sensor.cleargrass_2_co2
style:
top: 6%
left: 30%
card_mod:
style:
hui-state-label-element:
$: |
div {
color: orange;
}
image: /local/images/white.jpg

Update (20.05.22):
I recommend to use the 1st method.
The 2nd method sometimes does not work:
- Open a view with this card.
- Set the toggle to OFF. The conditional element is not displayed.
- Refresh the page.
- Set the toggle to ON. The conditional element is displayed.
- The conditional element may not be of orange color - this is a glitch.
- Refresh the page.
- The conditional element is of orange color.
So, the glitch occurs if the conditional element is not displayed first, then it is displayed w/o the style. The style is applied after refresh only.
Alternatively, on step 6 got to another view and then return to the view - the style is applied.
Also - same problem with a Conditional row inside Entities card. There is an issue on Github.