# How to add css as per the login?

**URL:** <https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360>\
**Category:** Developing Nodes\
**Created:** [18 October 2021 11:03 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360 "2021-10-18T11:03:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [18 October 2021 11:03 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/1 "2021-10-18T11:03:47Z")

</div>

Hi there, I want to add some css to another html code written in template node according to the person who is logged in. I have my login code in another template node and other html codes in different template node. I am not getting how to apply those css properties after login

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 October 2021 13:08 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/2 "2021-10-18T13:08:04Z")

</div>

Assuming that your Dashboard nodes are up to date, you can pass msg.className to a dashboard widget to change the widget class and so apply custom CSS.

You might get some tips from [this post](https://discourse.nodered.org/t/dynamic-css-changes-in-dashboard-v3beta/50866) where widgets' appearance is changed by clicking buttons.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [18 October 2021 13:21 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/3 "2021-10-18T13:21:39Z")

</div>

Won't the css apply to all logged in users, not just this one?

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [18 October 2021 13:26 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/4 "2021-10-18T13:26:40Z")

</div>

Do you mean different users logged in simultaneously? It probably will do yes since Node-Red is essentially single user.

I don't know how @Nisha records someone as logged in, maybe s/he is addressing this problem.  
I know there are efforts going on to adapt NR to multi-user situations.

---

<div class="post-metadata">

**Author:** ![Nisha](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/nisha/32/45331_2.png) [@Nisha](https://discourse.nodered.org/u/Nisha)\
**Post date:** [19 October 2021 04:57 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/5 "2021-10-19T04:57:37Z")

</div>

I have UI application in which I want to add multiple user login so, I have multiple flows for every UI page and I want some content to be hidden for "user" login and everything to be shown on "admin" login. In my case, I have side menu and on that i want to hide 2 tabs for normal user and those tabs to be shown when admin is logged in. And for this I have flow for login and other flows for every page. How can I add hide and show property of css based on the login user?

---

<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:** [18 December 2021 04:58 UTC](https://discourse.nodered.org/t/how-to-add-css-as-per-the-login/52360/6 "2021-12-18T04:58:24Z")

</div>

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