Hi,
I have a Grafana graph embedded in an iframe and I want to change the URL to present either light or dark mode based on whether the browser is in that mode.
If you have a browser mod, it includes a binary sensor for the device to detect dark mode. You can set the visibility condition of the card for a specific mod accordingly. If not, you have to create your own sensor.
You can set different styles dependently on a mode. Go to main cardmod thread - 1st post - fantastic link - others - how to set different styles for light and dark mode.
Also note that it can be simpler: standard css variables like “—card-background” (hope I spelled it properly) already have mode-dependent values.
I have card-background-color correctly set in my style file, and plotly-graph card (and all others) are showing it correct, but the iframe card with a transparent Grafana is not showing this card-background-color.