webpack-bundle-analyzer icon indicating copy to clipboard operation
webpack-bundle-analyzer copied to clipboard

Dark mode optional

Open dsshard opened this issue 1 year ago • 2 comments

Hi! This is a super cool product, and often helps me out. Thank you!

I really miss the dark mode, since I often work at night, and the abrupt switch to the "light" tab is very irritating to the eyes.

I made a patch for myself that simply makes the body background #000 and it helps me. But it would be cool to add this as an option for the settings.

Thanks again for the product, you are awesome!

dsshard avatar Oct 21 '24 11:10 dsshard

https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/643

dsshard avatar Oct 21 '24 12:10 dsshard

Yeah a dark mode could be useful. I'd rather avoid adding a new option for it, though — but some sort of a UI feature for a dark mode could be useful.

I could imagine that it'd work like this:

  1. Check localStorage if a light/dark mode setting has been previously selected. If so, use that selection.
  2. Check prefers-color-scheme and use that as a default
  3. Allow user to override what prefers-color-scheme had and persist that to localStorage

The simplest first iteration could be to only add support for prefers-color-scheme and not mess with localStorage at all.

Here's a great article about dark/light mode toggles and things worth considering: https://frontendmasters.com/blog/no-fuss-light-dark-modes/

valscion avatar Nov 14 '24 12:11 valscion

Hi! I am a beginner and would like to work on implementing the optional dark mode feature as part of my first open-source contribution. Could you please assign this issue to me?

Nitin-kumar-yadav1307 avatar Oct 18 '25 18:10 Nitin-kumar-yadav1307

Can't assign you but feel free to pick this up

evenstensberg avatar Oct 18 '25 21:10 evenstensberg

Looks like it was possible to assign this issue to @Nitin-kumar-yadav1307 after all! I'll keep this one for you for a while, let us know if you hit obstacles @Nitin-kumar-yadav1307

valscion avatar Oct 20 '25 06:10 valscion

Thanks a lot for assigning this issue to me! .I’ve successfully set up the project locally and started implementing the Dark Mode toggle in the sidebar. I’ve added the feature and rebuilt the project however, I can’t yet see the dark mode toggle reflected in the running app. I’m currently debugging to identify what might be preventing it from showing up. Please let me know if there’s any specific setup or component I should check to ensure the toggle renders correctly.

Nitin-kumar-yadav1307 avatar Oct 20 '25 07:10 Nitin-kumar-yadav1307

Please don't use ai when communicating. Thanks.

evenstensberg avatar Oct 20 '25 19:10 evenstensberg

@Nitin-kumar-yadav1307 I've unassigned you now since two weeks have passed and there hasn't been much new progress to show here.

So this issue is again up for grabs for anyone interested ☺️

valscion avatar Nov 05 '25 10:11 valscion

sorry , i don't know i have to show my progresses and i am stuck at a issuse but im still working on it, do i still work on it as not assignee?

Nitin-kumar-yadav1307 avatar Nov 05 '25 10:11 Nitin-kumar-yadav1307

You can but it's also possible that someone else beats you to it. But given that this issue has been open for more than a year now, it doesn't sound likely

valscion avatar Nov 05 '25 11:11 valscion