-
Notifications
You must be signed in to change notification settings - Fork 229
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
Support an ability to switch the UI to a dark mode #319
base: vue
Are you sure you want to change the base?
Conversation
The Screenshots are really looking awesome |
thanks for taking the time to submit a pull request. We are planning to use server side rendering for some pages (mostly admin pages and other pages that do not require live updates) so I'm not sure we want to use a toggle or store this value in local storage. Instead perhaps we should detect whether or not the host OS uses dark mode. let me think about this a little more and then get back to you ... |
@bradrydzewski Great to hear your thought on the plan. Perhaps it can be implemented in a way that a theme defaults to the host OS mode, but still, let a user change and stick to that preference thereafter. Moreover, I think the theme should not be global across all the user's browser. That is why I decided to use local storage in this case. Anyways, I'm very open to suggestions. Keep me posted about the next step. |
agreed
agreed this would be ideal, but I think the implementation is tricky when you consider server side renders. Perhaps a cookie would be a better approach since this could be read by the server and used to return the appropriate markup. Just thinking out loud ... edit: also as an aside, we probably want to change the color of the logs section in dark mode. It currently looks a little off since it is a different hue than the other colors on the page. |
@bradrydzewski Ah I see your point regarding the server-side renders, a cookie would be a better approach in this case as you said. Still have a question about changing a theme on the fly, should both default and dark theme (CSS) be bundled together as in this implementation so that when a user changes it, a page doesn't have to be reloaded? Or is there any way to serve them separately from the server-side (not sure about the implementation here)? |
@bradrydzewski server-side rendering shouldn't be a problem since this only changes the css beside the base dark theme class assignment. |
Please don't let this die, it looked great 🙏 |
Looks nice! when it will be merged? |
@bradrydzewski plz don't let this one die, would love a dark mode option |
Any plans to merge this? I'd love to have this! |
This would be super nice! |
is that still alive and going well? whats the timeline if answer is yes? |
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.
🕶️
Any plans to eventually merge this? |
@bradrydzewski Could this be merged please? Our eyes demand darkness! :) |
Any chance on this merging soon? Looks really good! @bradrydzewski |
2.5 years. lgtm. all the white is really annoying. |
I was annoyed too and created this bookmarklet.
|
Crazy that a product geared towards devs and such that often prefer to keep their eyes in their sockets doesnt have a dark mode. Any chance we could get one at some point? The searing white kills me any time I go to my tab for drone. |
i consider drone abandonware now. i smelled that since the harness takeover. in the meantime, until i can manage to migrate my entire ci to another oss solution, i'm using the booklet above. |
According to #314, this PR adds an ability to switch the UI to a dark mode.
Here are screenshots of the main UI.
Changes
src/assets/styles/_variables.scss
)src/assets/styles/_mixins.scss
)src/lib/theme.js
)This keeps the default UI the same. All colors are properly adjusted for the dark mode. In order to support a dynamic theme switching, two SCSS mixins have been introduced in this PR:
themed()
,themed-only()
.For example, if we want to add support for the dark theme to a following SCSS selector
We can wrap it with the
themed
mixin and get the color by atget()
function.With colors defined separately in
_variable.scss
, the above code will be transpiled to CSS as follows:I hope this might be a cool feature for Drone UI. If there is any suggestion or improvement that I can contribute to, please let me know.
Thank you.