Color mode does not take system theme in consideration after initial load #7938

Closed
opened 2025-12-29 20:30:14 +01:00 by adam · 7 comments
Owner

Originally created by @abhi1693 on GitHub (Apr 24, 2023).

NetBox version

v3.4.8

Python version

3.10

Steps to Reproduce

  1. Set system theme to dark
  2. Clear brower cache and local storage
  3. Notice the UI shows dark
  4. Change the system theme to light
  5. No change is seen on the UI

Expected Behavior

Theme should work with system theme if user prefers it

Observed Behavior

Theme discards user preference

Originally created by @abhi1693 on GitHub (Apr 24, 2023). ### NetBox version v3.4.8 ### Python version 3.10 ### Steps to Reproduce 1. Set system theme to dark 2. Clear brower cache and local storage 3. Notice the UI shows dark 4. Change the system theme to light 5. No change is seen on the UI ### Expected Behavior Theme should work with system theme if user prefers it ### Observed Behavior Theme discards user preference
adam added the type: bugstatus: blockedtopic: UI/UXseverity: low labels 2025-12-29 20:30:14 +01:00
adam closed this issue 2025-12-29 20:30:15 +01:00
Author
Owner

@abhi1693 commented on GitHub (Apr 24, 2023):

I have solved this issue in https://github.com/netbox-community/netbox/tree/fix/color-mode by introducing a new preference called system, when set uses the system theme else uses whatever the user prefers from light or dark. Note that this also considerably reduces the logic simplifying the underlying code.

Currently, the branch is built using feature as it introduces a new variable.

@abhi1693 commented on GitHub (Apr 24, 2023): I have solved this issue in https://github.com/netbox-community/netbox/tree/fix/color-mode by introducing a new preference called `system`, when set uses the system theme else uses whatever the user prefers from light or dark. Note that this also considerably reduces the logic simplifying the underlying code. Currently, the branch is built using feature as it introduces a new variable.
Author
Owner

@arthanson commented on GitHub (Jun 27, 2023):

@abhi1693 assigning to you as it looks like you have a PR

@arthanson commented on GitHub (Jun 27, 2023): @abhi1693 assigning to you as it looks like you have a PR
Author
Owner

@abhi1693 commented on GitHub (Jun 27, 2023):

@arthanson The PR I have is incomplete and isn't working as I expected it. I did not want to hold someone else off with this if they had a better solution as I was stuck in getting this fixed.

I can look into this again maybe next week though.

@abhi1693 commented on GitHub (Jun 27, 2023): @arthanson The PR I have is incomplete and isn't working as I expected it. I did not want to hold someone else off with this if they had a better solution as I was stuck in getting this fixed. I can look into this again maybe next week though.
Author
Owner

@github-actions[bot] commented on GitHub (Dec 14, 2023):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Do not attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Dec 14, 2023): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. **Do not** attempt to circumvent this process by "bumping" the issue; doing so will result in its immediate closure and you may be barred from participating in any future discussions. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@jeremystretch commented on GitHub (Dec 14, 2023):

Marking this as blocked by #12128

@jeremystretch commented on GitHub (Dec 14, 2023): Marking this as blocked by #12128
Author
Owner

@arthanson commented on GitHub (Jan 24, 2024):

I think this is a non bug, you have to actually have to clear out "cookies and other site data" for this to work with the reproduction steps above. Doing so will cause you to be logged out and removes the cookie settings, if you refresh the page you will see that you have to log back in and then can change the light/dark mode.

@arthanson commented on GitHub (Jan 24, 2024): I think this is a non bug, you have to actually have to clear out "cookies and other site data" for this to work with the reproduction steps above. Doing so will cause you to be logged out and removes the cookie settings, if you refresh the page you will see that you have to log back in and then can change the light/dark mode.
Author
Owner

@arthanson commented on GitHub (Apr 11, 2024):

This is a non-issue in NB 4, you need to clear the browser cache and cookies which will log you out, when you log back in you will get the color that you have specified in settings. Closing

@arthanson commented on GitHub (Apr 11, 2024): This is a non-issue in NB 4, you need to clear the browser cache and cookies which will log you out, when you log back in you will get the color that you have specified in settings. Closing
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7938