-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add dark mode #1554
Add dark mode #1554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great start @matt852!
I'd like to see this go just a bit further, referencing a guide like this: https://css-tricks.com/a-complete-guide-to-dark-mode-on-the-web/
-
Using browser preference settings (I'm a day-time light mode, night-time dark mode user)
-
Handling the buttons which look weird IMHO with black text.
@bryanculver I've updated the buttons, the status backgrounds, etc to always use white text. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty cool! A few thoughts:
- Add an option to revert to system default theme after setting a manual theme? https://kilianvalkhof.com/2020/design/your-dark-mode-toggle-is-broken/
- Do rack-elevation SVGs render correctly in dark mode?
- How well do the Swagger (/api/docs/) and GraphiQL (/graphql/) pages render in dark mode?
@glennmatthews @bryanculver I've addressed all of your feedback, and included screenshots for the various areas of concern. From my earlier comment: I added in support for 3 options: light mode, dark mode, and system settings. With adding a third, the toggle idea with the "light/dark" text in the footer wasn't as viable, so I created a modal that pops up. Upon selecting a theme, the page refreshes and the modal closes, or you can simply cancel out of it. "System" theme is set by default right now. I can change this if desired. Please let me know your thoughts or concerns. I know it's slightly different without using a fully separate light/dark stylesheet, but I believe it will work well until there's a broader UI overhaul and push towards Bootstrap 5 (or some other update). EDIT: I'm just looking for overall feedback at the moment. I want to figure out some integration tests first and check a few more things. I'll let you know when it's ready for approval/merging. |
# Conflicts: # nautobot/core/templates/base.html
I've confirmed the Rack elevation is dark, but when selecting "Save SVG", the SVG is rendered in light mode (as requested). |
Retargeted at |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😎
Closes: #729
What's Changed
I added dark mode to Nautobot. This makes minimal changes to the existing CSS configurations and continues using Bootstrap 3.
I added a small toggle feature using Javascript to the footer that allows toggling between light and dark mode.
The setting is saved client side on the client computer, and will remain set unless the user clears the browser session data (or uses something like incognito mode).
This does not make and database changes or store any theme-related data server-side.