# CSS not loading on page open/refresh in dashboard-2 custom UI node

**URL:** <https://discourse.nodered.org/t/css-not-loading-on-page-open-refresh-in-dashboard-2-custom-ui-node/95999>\
**Category:** Developing Nodes\
**Tags:** node-red-dashboard, dashboard-2\
**Created:** [14 March 2025 11:38 UTC](https://discourse.nodered.org/t/css-not-loading-on-page-open-refresh-in-dashboard-2-custom-ui-node/95999 "2025-03-14T11:38:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [14 March 2025 11:38 UTC](https://discourse.nodered.org/t/css-not-loading-on-page-open-refresh-in-dashboard-2-custom-ui-node/95999/1 "2025-03-14T11:38:14Z")

</div>

I am about to release a new version of my custom UI node (`omrid01/node-red-dashboard-2-table-tabulator`). I have predefined CSS class names, which the user can piggyback and apply custom CSS to the page widgets.  
The widget HTML is:

```auto
<template>
	<div class="ui-tabulator-wrapper">
		<div ref="tabulatorDiv" class="ui-tabulator-class"></div>
    </div>
</template>

```

So if I define either of the above 2 classes in a related `template` CSS node, it should propagate into the widget. ui\_tabulator-wrapper works with no issues,

```auto
.ui-tabulator-class {
  border: 4px solid red;
}

```

When I open the page which includes the widget, or refresh it, the styling does not appear. However, if I move to another dashboard page and then return, the styling shows perfectly.

---

<div class="post-metadata">

**Author:** ![omrid](https://avatars.discourse-cdn.com/v4/letter/o/77aa72/32.png) [@omrid](https://discourse.nodered.org/u/omrid)\
**Post date:** [14 March 2025 11:50 UTC](https://discourse.nodered.org/t/css-not-loading-on-page-open-refresh-in-dashboard-2-custom-ui-node/95999/2 "2025-03-14T11:50:41Z")

</div>

Solved: add `!imporant` to the style property, to ensure it overrides the existing style.

---

<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:** [28 March 2025 11:51 UTC](https://discourse.nodered.org/t/css-not-loading-on-page-open-refresh-in-dashboard-2-custom-ui-node/95999/3 "2025-03-28T11:51:18Z")

</div>

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