[wp-trac] [WordPress Trac] #50051: Native support for dark mode
WordPress Trac
noreply at wordpress.org
Fri May 8 05:26:09 UTC 2020
#50051: Native support for dark mode
-----------------------------+--------------------------------
Reporter: mpwrdesign | Owner: (none)
Type: feature request | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses: ui, accessibility
-----------------------------+--------------------------------
Comment (by sabernhardt):
The video describes 4 methods, summarized as:
1. Use `color-scheme` [property] to declare support
2. Adopt `prefers-color-scheme` media query
3. Use `<picture>` for hero graphics
4. Consider using `var()` for color schemes
Adding the first two methods on the front end would mean individual themes
create both light and dark modes. Using something like `add_theme_support(
'light-dark-modes' )` might be part of the process. Also note: some themes
already work well as dark-only.
The `<picture>` tag method would need editor and/or media support if
adding multiple versions of an image to the content area. Other images for
consideration include featured images and maybe the site logo.
It's a little soon for many sites to use the CSS variable method
exclusively; that would need a fallback for Internet Explorer and other
old browsers. Also, the block editor's `editor-color-palette` does not
allow variables yet (#46498), though the palettes would need to start
supporting multiple selections for multiple schemes even with the current
hexadecimal color codes.
I use dark mode on my laptop and would appreciate more sites acknowledging
the preference. However, the major barrier to implementing dark mode is
not technical. Site administrators and editors would need to be aware of
the two modes and verify all content will work in both before publishing.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/50051#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list