# Change md-switch color of default icon

**URL:** <https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499>\
**Category:** Dashboard\
**Created:** [16 July 2021 16:48 UTC](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499 "2021-07-16T16:48:41Z")\
**Posts on this page:** 4\
**Page:** 2

<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:** [17 July 2021 11:37 UTC](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499/22 "2021-07-17T11:37:56Z")

</div>

Thanks.  
So the work-around (from Steve-Mcl at [https://discourse.nodered.org/t/dashboard-element-css-classes/46447](https://discourse.nodered.org/t/dashboard-element-css-classes/46447) is to use the node id.  
It's perfectly fine except:  
Unnecessary repetition of CSS to style each element seperately.  
Quite difficult to work out from the node id in the CSS which node in the editor it applies to - node id is (rightfully) largely out of sight.

Alternative 1 - Add a CSS class field to the node properties.  
Ideal for me. dceejay dislikes adding another field for each UI node type.

Alternative 2 - Use the node's Name field as a CSS class.  
Ugly and confusing.

Alternative 3 - There is no alternative 3?

---

<div class="post-metadata">

**Author:** ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)\
**Post date:** [17 July 2021 11:54 UTC](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499/23 "2021-07-17T11:54:41Z")

</div>

> [@jbudd](#):
>
> It's perfectly fine except:  
> Unnecessary repetition of CSS to style each element seperately.

That was exactly the reason I thought it sensible to permit adding class to UI elements.

I considered the same alternatives as you and came to same conclusions.

Hoping Dave will take another look / reconsider.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [17 July 2021 12:35 UTC](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499/24 "2021-07-17T12:35:50Z")

</div>

Am still thinking about it. But now on vacation for a while.

---

<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:** [31 July 2021 12:36 UTC](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499/25 "2021-07-31T12:36:48Z")

</div>

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

[Previous page](https://discourse.nodered.org/t/change-md-switch-color-of-default-icon/48499.md?page=1)
