[wp-trac] [WordPress Trac] #51656: add_theme_support() for 'wp-dark-theme' so plugins can use consistent CSS for dark themes

WordPress Trac noreply at wordpress.org
Wed Oct 28 18:41:21 UTC 2020


#51656: add_theme_support() for 'wp-dark-theme' so plugins can use consistent CSS
for dark themes
-------------------------+------------------------------
 Reporter:  mpol         |       Owner:  (none)
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Themes       |     Version:
 Severity:  normal       |  Resolution:
 Keywords:               |     Focuses:
-------------------------+------------------------------

Comment (by joyously):

 I think plugins shouldn't have CSS with colors, and it would work with any
 theme.
 If you insist on adding this, don't make it theme_support, like the
 already existing one for the editor: https://developer.wordpress.org
 /block-editor/developers/themes/theme-support/#dark-backgrounds
 It also can tie in with the dark mode(prefers_color_scheme(dark)), which
 ''should'' inform the theme of the change, not the theme informing
 everyone else, since that is a user choice. There are so many themes which
 allow the user to choose both foreground and background colors, so the
 theme doesn't really even know when it's in dark mode.

 Or maybe the existing add_theme_support should take two colors supplied by
 the theme, and there is a core function like `is_dark()` that defaults to
 false but checks the colors for darker than some middle gray or something.
 I think having a centralized place for the calculation would help everyone
 get it right more often.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/51656#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list