I have a Canvas where i display several Cards. They all have different property values. I want Canvas to change background color of the Cards depending on specifiv property values.
Things I have tried
Thanks to the forum, I managed to do this with nested tags tags like so:
The reason why we’re able to target the tags is that the tag value is included within the html tag attributes. If we look at an example property of propKey: propValue in the Developers Tool > Element we see the following:
This is somewhat simplified but the key thing to notice is that we don’t see the propValue within the attributes of any elements. We do however see the aria-label of the metadata-property-key-input holding the value of propKey. This is in other words targetable.
To target that property element within a note one could use:
Sadly, when a note is included in a canvas these property elements are not shown within the canvas element being displayed… The corresponding block to this property example is:
And that is a not-targetable property definition when this note is presented in the canvas. Furthermore my example happened to have both a tag and an inline field also present, and the only thing begin shown which was targetable was the tag.
tl;dr So for now I think your best (and possibly only option) is to use a tag like described before.