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

**URL:** https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000
**Category:** Dashboard
**Created:** [4 July 2021 09:16 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000 "2021-07-04T09:16:36Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![TimoB2005](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/timob2005/32/44256_2.png) [@TimoB2005](https://discourse.nodered.org/u/TimoB2005)
#### Post date: [4 July 2021 09:16 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000/1 "2021-07-04T09:16:36Z")

</div>

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

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 July 2021 12:13 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000/2 "2021-07-04T12:13:03Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![TimoB2005](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/timob2005/32/44256_2.png) [@TimoB2005](https://discourse.nodered.org/u/TimoB2005)
#### Post date: [4 July 2021 13:51 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000/3 "2021-07-04T13:51:15Z")

</div>

Can you give me an short example?

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [4 July 2021 16:29 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000/4 "2021-07-04T16:29:49Z")

</div>

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.

> **[Node-RED Dashboard Template Examples (AngularJS)](https://it.knightnet.org.uk/kb/nr-qa/dashboard-template-examples/)**
>
> Some examples of using AngularJS with the Node-RED Dashboard.
> Not all features of Angular are accessible via the Dashboard.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [3 August 2021 16:30 UTC](https://discourse.nodered.org/t/how-can-i-change-the-css-of-my-dashboard-via-js/48000/5 "2021-08-03T16:30:37Z")

</div>

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