From 26b9de98122b461b180ab5989c59982da5d428fc Mon Sep 17 00:00:00 2001 From: "Daniel W. Robert" Date: Wed, 7 Sep 2022 15:31:53 -0400 Subject: [PATCH 1/4] Add docblocks to hooks used in customizer class. This resolves PHP linting errors. --- inc/customizer/class-storefront-customizer.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/inc/customizer/class-storefront-customizer.php b/inc/customizer/class-storefront-customizer.php index e2b29064a..276de2c85 100644 --- a/inc/customizer/class-storefront-customizer.php +++ b/inc/customizer/class-storefront-customizer.php @@ -858,7 +858,11 @@ public function get_css() { * @package storefront * @since 2.0.0 */ +<<<<<<< HEAD $brighten_factor = apply_filters( 'storefront_brighten_factor', 25 ); +======= + $brighten_factor = apply_filters( 'storefront_brighten_factor', 25 ); +>>>>>>> f7bdc6c5 (Add docblocks to hooks used in customizer class.) /** * Filters for darkening color value. * @@ -866,7 +870,11 @@ public function get_css() { * @package storefront * @since 2.0.0 */ +<<<<<<< HEAD $darken_factor = apply_filters( 'storefront_darken_factor', -25 ); +======= + $darken_factor = apply_filters( 'storefront_darken_factor', -25 ); +>>>>>>> f7bdc6c5 (Add docblocks to hooks used in customizer class.) $styles = ' .main-navigation ul li a, From ad9d391b60c7e82dbf67af692963a5d8b70f4720 Mon Sep 17 00:00:00 2001 From: "Daniel W. Robert" Date: Wed, 7 Sep 2022 15:48:55 -0400 Subject: [PATCH 2/4] Omit feat items blocks from txt color selector Confirmed that the featured items WooCommerce blocks are the only Woo blocks with a dark overlay. By omiting them from the ruleset that sets the default text color, we allow the block to use it's set default of white text over the background overlay, improving color contrast. --- inc/customizer/class-storefront-customizer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/customizer/class-storefront-customizer.php b/inc/customizer/class-storefront-customizer.php index 276de2c85..2b00f6299 100644 --- a/inc/customizer/class-storefront-customizer.php +++ b/inc/customizer/class-storefront-customizer.php @@ -1254,7 +1254,7 @@ public function block_editor_customizer_css() { /* WP <=5.3 */ .editor-styles-wrapper .editor-block-list__block, /* WP >=5.4 */ - .editor-styles-wrapper .block-editor-block-list__block { + .editor-styles-wrapper .block-editor-block-list__block:not(.wp-block-woocommerce-featured-product):not(.wp-block-woocommerce-featured-category) { color: ' . $storefront_theme_mods['text_color'] . '; } From 4fab27fec5e757f744f1a3ed10c120a86ed9c602 Mon Sep 17 00:00:00 2001 From: "Daniel W. Robert" Date: Fri, 9 Sep 2022 15:14:44 -0400 Subject: [PATCH 3/4] Refactor to use :has() selector. Instead of directly targeting the Featured Items blocks, we can use the `:has()` selector to omit blocks that contain a child div with the `has-background-dim` class in the editor. Since browser support is not to where we need at the time of publishing this, we can also add a temp fallback with `@supports`. --- inc/customizer/class-storefront-customizer.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/inc/customizer/class-storefront-customizer.php b/inc/customizer/class-storefront-customizer.php index 2b00f6299..e4e5aa2dd 100644 --- a/inc/customizer/class-storefront-customizer.php +++ b/inc/customizer/class-storefront-customizer.php @@ -1254,9 +1254,15 @@ public function block_editor_customizer_css() { /* WP <=5.3 */ .editor-styles-wrapper .editor-block-list__block, /* WP >=5.4 */ - .editor-styles-wrapper .block-editor-block-list__block:not(.wp-block-woocommerce-featured-product):not(.wp-block-woocommerce-featured-category) { + .editor-styles-wrapper .block-editor-block-list__block:not(:has(div.has-background-dim)) { color: ' . $storefront_theme_mods['text_color'] . '; } + /* This following ruleset is a fallback for browsers that do not support the :has() selector. It can be removed once support reaches our requirements. */ + @supports not (selector(:has(*))) { + .editor-styles-wrapper .block-editor-block-list__block:not(.wp-block-woocommerce-featured-product, .wp-block-woocommerce-featured-category) { + color: ' . $storefront_theme_mods['text_color'] . '; + } + } .editor-styles-wrapper a, .wp-block-freeform.block-library-rich-text__tinymce a { From 5b604f7dbbd080549a424ff85159cb343bda541f Mon Sep 17 00:00:00 2001 From: "Daniel W. Robert" Date: Fri, 9 Sep 2022 16:08:40 -0400 Subject: [PATCH 4/4] Remove/resolve items from merge conflict. --- inc/customizer/class-storefront-customizer.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/inc/customizer/class-storefront-customizer.php b/inc/customizer/class-storefront-customizer.php index e4e5aa2dd..c279389a5 100644 --- a/inc/customizer/class-storefront-customizer.php +++ b/inc/customizer/class-storefront-customizer.php @@ -858,11 +858,7 @@ public function get_css() { * @package storefront * @since 2.0.0 */ -<<<<<<< HEAD $brighten_factor = apply_filters( 'storefront_brighten_factor', 25 ); -======= - $brighten_factor = apply_filters( 'storefront_brighten_factor', 25 ); ->>>>>>> f7bdc6c5 (Add docblocks to hooks used in customizer class.) /** * Filters for darkening color value. * @@ -870,11 +866,7 @@ public function get_css() { * @package storefront * @since 2.0.0 */ -<<<<<<< HEAD $darken_factor = apply_filters( 'storefront_darken_factor', -25 ); -======= - $darken_factor = apply_filters( 'storefront_darken_factor', -25 ); ->>>>>>> f7bdc6c5 (Add docblocks to hooks used in customizer class.) $styles = ' .main-navigation ul li a,