Replies: 4 comments
-
|
Since the "Enable light mode" button is a NetBox feature, the question is: How exactly is the behavior different from other NetBox views? I think we shouldn't do anything special here. It should work just like in other views. Btw. I wasn't able to reproduce this issue so far, neither with system dark mode, nor with browser dark mode. |
Beta Was this translation helpful? Give feedback.
-
|
For reproducing the issue, if you run "console.log(documentElement.dataset.netboxColorMode)" on any netbox page does that return undefined for you on netbox 4.5.5 or do you get light or dark? If its not undefined for you on 4.5.5 then maybe something went wrong with my netbox upgrade. As far as listening for color changes triggered by clicking on the "enable light mode" button it appears that netbox 4.4.0 implemented a standard way for plugins to handle that: netbox-community/netbox#18006 |
Beta Was this translation helpful? Give feedback.
-
|
I think you mean "document.documentElement.dataset.netboxColorMode". Yes, it's undefined. Nevertheless, I'm not able to reproduce the issue. Sometimes it helps to clean the browser cache for issues like yours. In order to help reproducing the issue, you may tell us:
|
Beta Was this translation helpful? Give feedback.
-
|
Yes you are correct, I meant console.log(document.documentElement.dataset.netboxColorMode). No change after clearing the browser cache. OS is Win11 25H2 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
NetBox version
v4.5.5
Topology Views version
v4.5.0
Steps to Reproduce
Have your system set to dark mode and open the Topology view
Expected Behavior
All labels to be color #fff
Observed Behavior
All labels are color #000
I believe this is related to this line of code in app.js:
color:document.documentElement.dataset.netboxColorMode==="dark"?"#fff":"#000"
document.documentElement.dataset.netboxColorMode is undefined in my installation of netbox 4.5.5 (recently upgraded from netbox 4.3)
As a quick fix I've adjusted that line to use color:document.documentElement.dataset.bsTheme which seems to report light/dark correctly, however I think long term there should just be an option to customize the label color (and possibility other font related options as well).
One issue with my quick fix is that clicking on the "Enable light mode" button in netbox does not trigger a label color change, there should probably be a listener added for that.
Beta Was this translation helpful? Give feedback.
All reactions