How to use the Switch to control the other elements with CSS?

in floorplan,use these codes in floorplan.yaml

- name: Switchs
- switch.humidifier2
domain: homeassistant
service: toggle
- state: ‘off’
class: ‘light-off’
- state: ‘on’
class: light-on’

and use these code in floorplan.css
.light-off {
fill: #FFFF78 !important;
fill-opacity: 1 !important;
.light-on {
fill: #000000 !important;
fill-opacity: 1 !important;

we can click the switch-icon(switch.humidifier2) to control the switch on/off, and use CSS to change the
color of the switch-icon.

but I want to know, when I click the switch-icon,how to change the other element’s color (element for example:bedroom_light_shine)?thanks very much!