From 247611b0f055fc48d19bad7b460d583a414cc85d Mon Sep 17 00:00:00 2001
From: Jb Audras <audrasjb@git.wordpress.org>
Date: Tue, 25 Jul 2023 14:42:22 +0000
Subject: [PATCH] Twenty Twenty-One: Enable Dark Mode in the block editor
 iframe.

This changeset 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`. This fixes an issue when activating dark mode in Twenty Twenty-One, where dark mode was not enabled in the block editor.

Props poena, mikinc860, huzaifaalmesbah, hasanuzzamanshamim, Ankit-K-Gupta.
Reviewed by desrosj, audrasjb.
Merges [56300] to the 6.3 branch.
Fixes #58835.




git-svn-id: https://develop.svn.wordpress.org/branches/6.3@56304 602fd350-edb4-49c9-b593-d223f7449a82
---
 .../classes/class-twenty-twenty-one-custom-colors.php           | 2 +-
 .../classes/class-twenty-twenty-one-dark-mode.php               | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php
index 3b6833c388..03dbd308b4 100644
--- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php
+++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-custom-colors.php
@@ -23,7 +23,7 @@ class Twenty_Twenty_One_Custom_Colors {
 		add_action( 'wp_enqueue_scripts', array( $this, 'custom_color_variables' ) );
 
 		// Enqueue color variables for editor.
-		add_action( 'enqueue_block_editor_assets', array( $this, 'editor_custom_color_variables' ) );
+		add_action( 'enqueue_block_assets', array( $this, 'editor_custom_color_variables' ) );
 
 		// Add body-class if needed.
 		add_filter( 'body_class', array( $this, 'body_class' ) );
diff --git a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php
index ceb3a4de90..ec599cfd0b 100644
--- a/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php
+++ b/src/wp-content/themes/twentytwentyone/classes/class-twenty-twenty-one-dark-mode.php
@@ -20,7 +20,7 @@ class Twenty_Twenty_One_Dark_Mode {
 	public function __construct() {
 
 		// Enqueue assets for the block-editor.
-		add_action( 'enqueue_block_editor_assets', array( $this, 'editor_custom_color_variables' ) );
+		add_action( 'enqueue_block_assets', array( $this, 'editor_custom_color_variables' ) );
 
 		// Add styles for dark-mode.
 		add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );