Please read https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme
I can do it if you approve me.
@andybons
This is a substantial amount of work. In design, implementation, and testing. We would not want to force dark mode users to only see the dark mode version, so we’d want a toggle.
@vitaly-zdanevich when you say you can do it, which parts are you planning to do?
@andybons it looks like not difficult task for me, and I believe that this is important accessibility feature. I hope that I can do all parts of it. So, if you approve it, and you think that we need explicit toggle also - maybe we can start with this toggle design. What is the appropriate position? At the bottom of every page? At the top? In some preferences screen?
In "Material" style, with label Dark theme at the left? Maybe not blue but gray.

Or maybe as a link, where text will be Dark mode off and Dark mode on:

We would not want to force dark mode users to only see the dark mode version, so we’d want a toggle.
If the user doesn't want to see dark mode, they can change the setting in their user agent or operating system. Adding a toggle on the website seems redundant.
@jayschwa I disagree. It’s not clear what user expectations are across the web with regard to this.
White theme is default on macOS and Firefox - if user manually changed it to dark - maybe he will not like to see that most of websites still white.
Screenshot from Firefox under Ubuntu:

Also Chromium from 73 became dark automatically if user switch dark mode inside operating system.
Dark mode, as a feature on the web, is very new. As I said above, we don’t have a thorough understanding of user expectations yet. I don’t think we can entertain this without a toggle.
Ok, so - I do not know your rules how you make decisions. We need to wait for other members to vote? For me this is not important - with or without toggle, I can implement both variants.
Before deciding about the toggle, shouldn't we decide whether we want a dark mode at all?
I've read https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme, but nothing there says every website must have a dark mode. So why it's a given that we want one?
We need dark mode for two reasons:
1) Because of sensitive eyes phenomena. For many people (including me) it is hurts to stairs at toxic WHITE. Especially at night, low-light conditions.
2) Save the battery.
Android 10 also have system wide dark theme for the same reasons. I remember that in this year (or in 2018, I do not remember) Google at Android conference said that this is recommended to have optional dark theme for every app.
And with this new prefers-color-scheme - if user agent says that he prefers dark mode - why we should ignore that?
On Android most apps have their own settings like
Would this be an option for a website as well? So instead of a toggle implementing a spinner?
The default one should then respect the operation defaults (or browser defaults) - not sure about the specification 😅.
What if we just make the web site gray on gray? Then it will work equally well in both modes.
More seriously, it seems like the web as a whole needs to figure out what the expectation is for default-white web sites (which is most of them, right?). In general we have a lot of web design work that goes into the pages, so it's not like we can just make up some hex codes and add a switch. Having two modes doubles the design work and adds complexity.
Let's wait on doing anything on this until more sites have figured out what to do. For example, google.com is still white in dark mode. If that changes, then I'd be more inclined to look into what golang.org should do.
Just going to leave this here:
https://twitter.com/pbakaus/status/1189057074925191168?s=09
Don't be that web site 😉
On Wed, Oct 9, 2019, 7:35 PM Russ Cox notifications@github.com wrote:
More seriously, it seems like the web as a whole needs to figure out what
the expectation is for default-white web sites (which is most of them,
right?). In general we have a lot of web design work that goes into the
pages, so it's not like we can just make up some hex codes and add a
switch. Having two modes doubles the design work and adds complexity.Let's wait on doing anything on this until more sites have figured out
what to do. For example, google.com is still white in dark mode. If that
changes, then I'd be more inclined to look into what golang.org should do.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/golang/go/issues/34601?email_source=notifications&email_token=ACOBQ65434LHEQORH4KRURDQNYI7RA5CNFSM4I3USUDKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAYV7PI#issuecomment-540106685,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ACOBQ62UMEW4O3U3P2K72O3QNYI7RANCNFSM4I3USUDA
.
My pull request to gobyexample.com with optional dark theme through prefers-color-scheme.
Most helpful comment
If the user doesn't want to see dark mode, they can change the setting in their user agent or operating system. Adding a toggle on the website seems redundant.