djangoproject.com icon indicating copy to clipboard operation
djangoproject.com copied to clipboard

Refs #1064 -- Add dark mode

Open sabderemane opened this issue 2 years ago • 11 comments

I have done something for the issue #1064 :)

Looks like that : Capture d’écran 2022-08-02 à 00 46 49

UPDATE:

  • Review accessibility colors for dark theme
  • Add CSS variables for each colors to make dark / light theme in CSS
  • Add switch button to toggle theme (it takes system preferences by default and override it if the button is clicked)
  • Change icon switch according Django admin switch based on Furo icon theme

sabderemane avatar Apr 12 '22 20:04 sabderemane

Thanks for working on this issue. Can you check the accessibility of colors in the dark version? It seems that some light text on a dark background has a low contrast level.

pauloxnet avatar Apr 14 '22 16:04 pauloxnet

Yes @pauloxnet , I didn't check all elements for the accessibility, I will do that and update the PR

sabderemane avatar Apr 14 '22 16:04 sabderemane

This is cool!

Having more (less?) contrast is important to readability. I find it really hard to read white on black text, but much easier if they're light and dark greys instead. That said, I strongly prefer light mode for docs, so this needs to have a switch that can override whatever is detected from OS/browser preference.

davidism avatar Apr 14 '22 16:04 davidism

Thank you! I understand, I will add button in the header for that.

sabderemane avatar Apr 14 '22 16:04 sabderemane

I'm happy to help with a toggle switch if needed!

dryan avatar Apr 14 '22 17:04 dryan

Hi folks, I finally finish it 😄 I updated the PR and the description. Happy to have feedbacks.

sabderemane avatar Apr 19 '22 09:04 sabderemane

Hi folks, I finally finish it smile I updated the PR and the description. Happy to have feedbacks.

Thank, it seems great. Can you add a screenshot of the documentation search result page ?

pauloxnet avatar Apr 19 '22 09:04 pauloxnet

Sure @pauloxnet Capture d’écran 2022-04-19 à 14 12 57

sabderemane avatar Apr 19 '22 12:04 sabderemane

Thank you @sabderemane

I have only two personal final thoughts:

  • I don't know if the word "dark mode" is redundant, I would leave only "dark" and "light" or remove it completely
  • I would make sure that the toggle button is always visible when viewed on mobile, therefore outside the hamburger icon menu

pauloxnet avatar Apr 19 '22 12:04 pauloxnet

Thank you for the feedback @pauloxnet

I see, first of all, I put the button only, I found it weird. We don't know really what is it about except by clicking on it.

May be like that it's better, what do you think ? Capture d’écran 2022-04-19 à 14 37 18 Capture d’écran 2022-04-19 à 14 37 05 I have to think of other options for the button and make proposal.

I would make sure that the toggle button is always visible when viewed on mobile, therefore outside the hamburger icon menu

Yes good point, actually it's on the menu but I will see to make it outside of the navigation.

sabderemane avatar Apr 19 '22 12:04 sabderemane

I have to think of other options for the button and make proposal.

I really like the way it's done in the Furo sphinx theme: https://pradyunsg.me/furo/ (Sorry for the borderline bikeshedding)

matthiask avatar May 16 '22 11:05 matthiask