Skip to content
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

add support for 'prefers-color-scheme' save our eyes @ night #858

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Alexander-Taran
Copy link

Please consider changing the world of github pages and other consumers of template to save our vision. (-:

@mattxwang
Copy link
Member

@pdmosses could I get your opinion on how this impacts your Combination PR + the general dark mode work that you've done?

@pdmosses
Copy link
Contributor

@mattxwang the Combination PR #578 doesn't include automatic switching because #464 and #560 are alternative ways of fixing issue #234, and I didn't know which would finally be merged.

In contrast to #464 and #560, the present PR doesn't update the color scheme on open pages until they are manually reloaded, I think? It's also not configurable.

Perhaps issue #234 is the best place to discuss the pros and cons of the alternative PRs.

@Alexander-Taran
Copy link
Author

It is not configurable. Yes.
Changes are automatic.
Although IE will not get any styling (-:
It also does not take into account that users can use their own "template"

I proposed this as a way.
I think that absence of window.matchMedia might be a feature detection fallback to this technique to support the non-evergreen browsers instead to append a style tag to head with no media-query.

@mattxwang
Copy link
Member

Okay, I think that this is

  • part of a larger discussion
  • not likely to be merged into v0.4.0, until we decide on the discussion

I'm going to label this PR as needs discussion. I'm not particularly well-versed in how JTD handles dark mode and will need to do a bit more reading; if another maintainer wants to take point on leading the color theme discussion, that would be great.

@mattxwang mattxwang added the status: needs discussion Issues that need more discussion before they can be properly triaged. label Jul 5, 2022
@mattxwang mattxwang linked an issue Jul 20, 2022 that may be closed by this pull request
@Alexander-Taran
Copy link
Author

Thoughts:
2 themes are there since the time when browsers did not support relative media query
So site author could decide on the theme.
Most of the sites using JTD are using one of default themes..
Providing auto-switching theme as a default and explaining in the docs how to force ones own theme is a better solution because out of the box most sites (that use defaults) will care about night mode..

@simonebortolin
Copy link
Contributor

I tried running this PR in my fork and noticed that it is necessary to modify this script

In https://github.com/simonebortolin/just-the-docs/tree/prefers-color-scheme

I have made a fix for the script that after the change in question at this PR no longer works

@mattxwang
Copy link
Member

Left a comment in #234 explaining what's necessary to get this in a mergeable state! Happy to have anybody take it on, and I can review it, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs discussion Issues that need more discussion before they can be properly triaged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support system-/browser-level dark mode
4 participants