[wp-trac] [WordPress Trac] #58835: Twenty Twenty-One: Dark mode is not enabled in the block editor iframe

WordPress Trac noreply at wordpress.org
Tue Jul 18 12:25:30 UTC 2023


#58835: Twenty Twenty-One: Dark mode is not enabled in the block editor iframe
---------------------------+---------------------
 Reporter:  poena          |       Owner:  (none)
     Type:  defect (bug)   |      Status:  new
 Priority:  normal         |   Milestone:  6.3
Component:  Bundled Theme  |     Version:  trunk
 Severity:  normal         |  Resolution:
 Keywords:                 |     Focuses:
---------------------------+---------------------

Comment (by poena):

 The patch replaces{{{ add_action( 'enqueue_block_editor_assets',}}} with
 {{{add_action( 'enqueue_block_assets',}}} in class
 Twenty_Twenty_One_Dark_Mode and
 class Twenty_Twenty_One_Custom_Colors.


 I need help with testing for any negative side effects, because
 {{{enqueue_block_assets}}} enqueues the CSS both in the editor and the
 front, while {{{enqueue_block_editor_assets}}} only enqueued it in the
 (non-iframed) editor.

 It might be possible to reduce some duplication of code in class
 Twenty_Twenty_One_Custom_Colors:

 https://core.trac.wordpress.org/browser/trunk/src/wp-
 content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-
 colors.php#L86

 https://core.trac.wordpress.org/browser/trunk/src/wp-
 content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-
 colors.php#L99

 I have not done this because I am unsure of how it will affect extenders
 like child themes.

 Related reading:
 https://make.wordpress.org/core/2023/07/18/miscellaneous-editor-changes-
 in-wordpress-6-3/#post-editor-iframed




 == Testing instructions:

 Download and activate the Beta tester plugin.
 Update the WordPress install to the nightly version of WordPress 6.3.
 Or if you are testing this issue after WordPress 6.3 is released, please
 make sure you have the latest version of WordPress installed.

 Activate Twenty Twenty-One.
 Go to Appearance > Customize, and open the panel Colors & Dark Mode.
 Enable the dark mode option (the check box).
 In the page preview, in the bottom right corner, enable the dark mode (the
 button).
 Now open the block editor.
 Confirm that the dark mode is enabled.

 Return to the Customizer and change the body background color.
 Confirm that the correct color is showing on the front, with and without
 dark mode enabled.
 Confirm that the correct color is showing in the block editor, with and
 without dark mode enabled.


 Test the theme update on older WordPress versions to confirm that the dark
 mode and custom colors still works in the editor and front.
 The theme supports 5.3 and above.

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


More information about the wp-trac mailing list