What is the proper way of removing the theme’s custom colors in editor ?
-
I’m not here talking about the color palette UI but about the :root color variables defined by Twenty Twenty One in the Twenty_Twenty_One_Custom_Colors class.
I have defined my own colors for variables and in the child theme front they work properly. For example –global–color-primary is not black but blue.
The problem is in the editor the text is still black because the theme’s colors take priority over my editor-style.css file.How do I override them, or remove the actions that Twenty Twenty One uses to add them?
i have tried removing the actions but it does not work. Any suggestion to get rid of those actions ?
* This class is in charge of color customization via the Customizer. */ class Twenty_Twenty_One_Custom_Colors { /** * Instantiate the object. * * @since Twenty Twenty-One 1.0 */ public function __construct() { // Enqueue color variables for customizer & frontend. add_action( 'wp_enqueue_scripts', array( $this, 'custom_color_variables' ) ); // Enqueue color variables for editor. add_action( 'enqueue_block_assets', array( $this, 'editor_custom_color_variables' ) ); // Add body-class if needed. add_filter( 'body_class', array( $this, 'body_class' ) ); }
I wanted to remove custom_color_variables and editor_custom_color_variables but it does not work. Any help welcome.
- The topic ‘What is the proper way of removing the theme’s custom colors in editor ?’ is closed to new replies.