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

Authoring best practices for supporting prefers-color-theme: dark media query #3063

Open
jongund opened this issue Jul 23, 2024 · 2 comments
Labels
question Issue asking a question

Comments

@jongund
Copy link
Contributor

jongund commented Jul 23, 2024

Operating systems support light and dark color themes, typically the setting is part of appearance or display options and not in the "accessibility" options section.

The light color theme is typically the default on most operating systems. Authors can identify the color theme setting through the CSS media query prefers-color-theme.

The dark color theme is associated with lower power consumption, less eye strain and considered easier to read or less disruptive in dark settings (e.g. night time). People with some types of visual impairments prefer to use the dark color theme as their default. When the user selects the dark color theme the CSS media query prefers-color-theme is set to dark.

Questions:

  1. What are the best practices for support the prefers-color-theme media query to make web pages more accessible?
  2. Which WCAG requirements apply to this user preference?
  3. What should authors do to support both the light and dark color themes?
@mcking65 mcking65 added the question Issue asking a question label Jul 30, 2024
@jongund
Copy link
Contributor Author

jongund commented Jul 30, 2024

Wikipedia supports light and dark color preferences through an "appearance" button, which visually looks like eye glasses at the beginning (e.g. top) of the page.

@erikgiovani
Copy link

Operating systems support light and dark color themes, typically the setting is part of appearance or display options and not in the "accessibility" options section.

The light color theme is typically the default on most operating systems. Authors can identify the color theme setting through the CSS media query prefers-color-theme.

The dark color theme is associated with lower power consumption, less eye strain and considered easier to read or less disruptive in dark settings (e.g. night time). People with some types of visual impairments prefer to use the dark color theme as their default. When the user selects the dark color theme the CSS media query prefers-color-theme is set to dark.

Questions:

  1. What are the best practices for support the prefers-color-theme media query to make web pages more accessible?
  2. Which WCAG requirements apply to this user preference?
  3. What should authors do to support both the light and dark color themes?

It is best to give the user a choice between the system default, light or dark, as not all people can read well on dark backgrounds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Issue asking a question
Projects
None yet
Development

No branches or pull requests

3 participants