How can i change the css of my dashboard via js?

Hey,

i want to change my css via js in nodered to set a color dynamic. But when i do it like me in raw js with document.getElementyById... bla bla it says "document is not defined". How can i change css in js with nodered is there any other "document"?? It should be dynamic

best regards

Dashboard uses the Angular v1 framework to provide dynamic ui's. You will want to do some reading about that. The ui_template node lets you set your own Styles and then you can swap between css classes based on data sent from node-red. You could also dynamically set styles as well but classes are usually easier to manage.

Can you give me an short example?

I rarely use Dashboard any more and dislike Angular so probably not.

However there are some examples on my blog and in the Node-RED Cookbook that may or may not help.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.