Can we set a camera image on an individual View background?

Continuing the discussion from Can we use camera image as background for card?:

I think a separate thread for this is easiest, so here goes:

card-mod-view: |
  hui-masonry-view {
    background: url({{state_attr('camera.weerkaart_nl','entity_picture')}});
  }

works when used in a theme. However this makes that happen on all Views applying the masonry (default) view. I’d like to be individual, just like the current background: option in View offers us now, and obviously tried this, which didnt work :wink:

Please have a look with me if and how we can realize this?

btw, as posted in the linked thread, I did manage to do something like:

    {% if state_attr('sensor.browsermod_safari','path') == '/ui-overview/weer_klimaat' %}
      hui-masonry-view {
        background: url({{state_attr('camera.weerkaart_nl','entity_picture')}});
      }
    {% endif %}

in my custom theme. It actually works, but is not what I am looking for. This makes all masonry view cards have that background, if and when that particular browser is on that view.

What I want is to set the background for that particular view, on any device, and only on that view.

just had a brainwave, to create a dedicated custom theme for that:

weather-background:
  card-mod-theme: weather-background
  card-mod-view: |
    hui-masonry-view {
      background: url({{state_attr('camera.weerkaart_nl','entity_picture')}});
    }

and use that in the Lovelace views:

title: Weblinks
path: weblinks
icon: mdi:web
theme: weather-background
cards:

  - !include /config/lovelace/buttons/buttons_shortcut_menu.yaml

  - !include /config/lovelace/includes/include_custom_card_links.yaml

  - !include /config/lovelace/includes/include_custom_card_links_not_used.yaml

etc etc

and voila!

Dec-24-2021 11-38-39