[wp-trac] [WordPress Trac] #53533: Twenty Twenty-One: Dark Mode creating conflict with custom colour inside editor

WordPress Trac noreply at wordpress.org
Tue Jun 21 08:38:41 UTC 2022


#53533: Twenty Twenty-One: Dark Mode creating conflict with custom colour inside
editor
-----------------------------+------------------------------
 Reporter:  alanjacobmathew  |       Owner:  (none)
     Type:  defect (bug)     |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Bundled Theme    |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |     Focuses:
-----------------------------+------------------------------

Comment (by poena):

 Hi!
 You are correct, the code in the theme does not update the custom colors
 when dark mode is enabled.
 This decision was made on purpose, many users would find it unexpected if
 the theme replaced their custom colors. But also because of the complexity
 of replacing the colors.

 When a user selects a custom color for a block using the color picker,
 WordPress adds the color code inline, directly on the element. Example:
 {{{<p class="has-text-color" style="color:#f20000">Paragraph</p>}}}

 To override it, the theme would need to parse all the **content** to find
 the exact colors, calculate which color to replace it with (light or
 dark), and override it by loading more CSS using {{{!important}}}.

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


More information about the wp-trac mailing list