-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Dark theme support for management plugin (Issue 3478) #13545
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
Conversation
Added light.css Added dark.css Added link for light.css and dark.css with media attribute Added switcher
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 is really great, thank you.
I started up RabbitMQ with your branch and browsed to the management UI using Chrome 134.0.6998.89. I did a force-refresh in case any previous assets were cached. My system (Windows 11) is dark mode by default, and everything came up dark as expected. I switched to light mode, and a few UI elements were still dark:
Let me know if there is any more information you need.
Another piece of feedback from our team: the Sun-and-Moon theme switcher feel really out of place. Can we steal (reuse) the switcher icon from rabbitmq.com (Docusaurus) instead? |
Removes color-scheme from main.css Added color-scheme: dark to dark.css Added color-scheme: light to light.css
@lukebakken, thanks, i missed this bug. It works well without switcher, for switcher it requires to manually define color-scheme in separate files that affect theme palette |
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.
Thank you! The issue I reported appears to be fixed, but I do see the following behavior. I saw it the first time I tested, but didn't report it in case it was a quirk.
- Set your system to dark theme
- Start up RabbitMQ using this code
- Open incognito window and browse to localhost:15672
- The login window appears dark, as expected. Log in.
- The UI is dark, as expected. Now, choose the light mode via the switcher. Nothing happens! See the following image, which shows that "Light" is selected.
If I then refresh the window, and choose "Light" again, it switches and continues to work correctly.
@michaelklishin, not quite sure "out of place" means where it is or only icon style? About icons - i just make them quick as possible, so they can be replaced by any icon you prefer. If it isn't restricted by license i can use icons from Docusaurus |
@efimov90 our website is MPL2-licensed while Docusaurus is MIT-licensed. |
OK, my AI lawyer says we can use the Docusaurus code / icons - https://www.google.com/search?q=mpl2+mit+license+compatibility If @efimov90 doesn't beat me to it, maybe I can figure it out. |
SVG code for light and dark icons from Docusaurus can be found here, in https://github.com/facebook/docusaurus/tree/main/packages/docusaurus-theme-classic/src/theme/Icon @efimov90 basically, we'd like the light/dark switcher to work the same as on rabbitmq.com. In other words, use the system default when the page loads, then clicking the icon switches the color mode, while also switching the icon. Keeping the switcher at the bottom of the page is fine with me, especially since you said it would be more difficult to move it up top. It has been years since I've looked at the management UI code, so thank you for taking this on. |
Adapts code to works with sammy.js
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 is awesome, thank you so much 👍
I didn't still realize how to fix bug with incognito browser window. I'm pretty sure it's EJS or Sammy.js problem with navigation. |
I don't see that issue anymore. Everything looks OK! |
@efimov90 here is an alpha build that includes this change. |
Proposed Changes
Implementation of dark theme.
Fixes #3478
Added support of dark theme to management plugin.


By default used system settings.
Added switcher to footer (i don't like it looks at header and don't want to make big changes).
Added a bit of organization for css colors for easier further tinkering/expand/reduce groups of colors.
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply.You can also fill these out after creating the PR.
If you're unsure about any of them, don't hesitate to ask on the mailing list.
We're here to help!
This is simply a reminder of what we are going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
If this is a relatively large or complex change, kick off the discussion by explaining why you chose the solution
you did and what alternatives you considered, etc.