1 Drag in the ui_template
2 Write or copy/paste the content into
3 Forget to change the template type to "CSS (All Pages)"
4 Deploy
5 Change the template type to "CSS (All Pages)"
6 Deploy
Result - you can not use this template anymore for CSS (group and page properties are not removed)
To make it working
1 Drag in the ui_template (and give it a name)
2 Change the template type to "CSS (All Pages)"
3 Write or copy/paste the content into
4 Deploy
:root{
/* relative url means that this image is served from your static folder. */
/* it works with absolute urls same as well but image loading takes time and all that stuff ...*/
--page-background: url(/images/bg-1.jpg);
}
.v-main {
background-image: var(--page-background);
background-size: cover;
}
Think of this as being a reference to the ui-template node. We automatically bind msg to the template, so you can access it with this.msg
Just overriding the CSS is possible, link from docs is above. If you want msg.payload, or some other factor to override the background, then you need to write some JS in order to override the document/body's background-image property (also the case in D1)
Yeah, thats almost what I posted in my 1st post here .. but this works only within the widget-backgroud ... I could not work for it on the page background. Thats why I tried with your static background-example
Can't you do this the native way instead of using Vue? Really not that hard to change a style or a class programmatically using the native JavaScript API's.