o thats interesting, was looking for that just today!
could you help me out here please, how to go about adding the mod card on this panel?
title: Plattegrond
path: plattegrond
icon: mdi:floor-plan
# background: center / cover no-repeat url('/local/images/areas/plattegrond.png') fixed
# type: custom:vertical-layout
panel: true
cards:
- type: vertical-stack
cards:
-
-
etc
I have darker and lighter themes, so would like to switch to a
background: center / cover no-repeat url('/local/images/areas/plattegrond_inversed.png') fixed
theme in my darker themes
on regular cards I use config-template-card for that with a
- title: Map
icon: mdi:map
type: panel
cards:
- type: custom:config-template-card
entities:
- input_select.theme
variables:
theme: states['input_select.theme'].state
card:
type: custom:auto-entities
filter:
include:
- domain: person
card:
type: map
hours_to_show: 48
dark_mode: ${(/ight|Dark|Matrix/).test(theme)}
on the card config… with a view, I wouldn’t n=know how to proceed.
or, are you saying, in panel mode, we only need to set the background on the vertical-stack?
update
Bingo! You’ve made my day, thank you so very much!
title: Plattegrond
path: plattegrond
icon: mdi:floor-plan
# background: center / cover no-repeat url('/local/images/areas/plattegrond.png') fixed
# type: custom:vertical-layout
panel: true
cards:
- type: custom:mod-card
style: |
ha-card {
background:
{{ "center / cover no-repeat url('/local/images/areas/plattegrond_inversed.png') fixed"
if states('input_select.theme') is search('ight|Dark|Matrix', ignorecase=True)
else
"center / cover no-repeat url('/local/images/areas/plattegrond.png') fixed" }};
}
card:
type: vertical-stack
cards:
works beautifully indeed!
Of course, its still not the same as setting a regular views background, but this comes close, and since I would be using it on only a couple of views, that indeed benefit from panel mode, I am not complaining
btw, this is a neater template for that:
{% set dark = states('input_select.theme') is search('ight|Dark|Matrix', ignorecase=True)%}
{% set extension = '_inversed' if dark else '' %}
{{"center / cover no-repeat url('/local/images/areas/plattegrond"~extension~".png') fixed" }}