From 07f58462ec54ccf9d6c5ff00060f611655d9de68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Mon, 2 Nov 2020 15:20:01 +0100 Subject: [PATCH] Fix WC Blocks styles not visible in the editor --- .../class-storefront-customizer.php | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/inc/customizer/class-storefront-customizer.php b/inc/customizer/class-storefront-customizer.php index 984124afc..69c09a3bc 100644 --- a/inc/customizer/class-storefront-customizer.php +++ b/inc/customizer/class-storefront-customizer.php @@ -870,50 +870,6 @@ public function get_css() { color: ' . $storefront_theme_mods['hero_text_color'] . '; } - .wc-block-components-price-slider__range-input-progress, - .rtl .wc-block-components-price-slider__range-input-progress { - --range-color: ' . $storefront_theme_mods['accent_color'] . '; - } - - /* Target only IE11 */ - @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { - .wc-block-components-price-slider__range-input-progress { - background: ' . $storefront_theme_mods['accent_color'] . '; - } - } - - .wc-block-components-button:not(.is-link) { - background-color: ' . $storefront_theme_mods['button_alt_background_color'] . '; - color: ' . $storefront_theme_mods['button_alt_text_color'] . '; - } - - .wc-block-components-button:not(.is-link):hover, - .wc-block-components-button:not(.is-link):focus, - .wc-block-components-button:not(.is-link):active { - background-color: ' . storefront_adjust_color_brightness( $storefront_theme_mods['button_alt_background_color'], $darken_factor ) . '; - color: ' . $storefront_theme_mods['button_alt_text_color'] . '; - } - - .wc-block-components-button:not(.is-link):disabled { - background-color: ' . $storefront_theme_mods['button_alt_background_color'] . '; - color: ' . $storefront_theme_mods['button_alt_text_color'] . '; - } - - .wc-block-cart__submit-container { - background-color: ' . $storefront_theme_mods['background_color'] . '; - } - - .wc-block-cart__submit-container::before { - color: ' . storefront_adjust_color_brightness( $storefront_theme_mods['background_color'], is_color_light( $storefront_theme_mods['background_color'] ) ? -35 : 70, 0.5 ) . '; - } - - .wc-block-components-order-summary-item__quantity { - background-color: ' . $storefront_theme_mods['background_color'] . '; - border-color: ' . $storefront_theme_mods['text_color'] . '; - box-shadow: 0 0 0 2px ' . $storefront_theme_mods['background_color'] . '; - color: ' . $storefront_theme_mods['text_color'] . '; - } - @media screen and ( min-width: 768px ) { .secondary-navigation ul.menu a:hover { color: ' . storefront_adjust_color_brightness( $storefront_theme_mods['header_text_color'], $brighten_factor ) . '; @@ -1019,6 +975,50 @@ public function gutenberg_get_css() { .wp-block-cover .wp-block-cover__inner-container h6:not(.has-text-color) { color: ' . $storefront_theme_mods['hero_heading_color'] . '; } + + .wc-block-components-price-slider__range-input-progress, + .rtl .wc-block-components-price-slider__range-input-progress { + --range-color: ' . $storefront_theme_mods['accent_color'] . '; + } + + /* Target only IE11 */ + @media all and (-ms-high-contrast: none), (-ms-high-contrast: active) { + .wc-block-components-price-slider__range-input-progress { + background: ' . $storefront_theme_mods['accent_color'] . '; + } + } + + .wc-block-components-button:not(.is-link) { + background-color: ' . $storefront_theme_mods['button_alt_background_color'] . '; + color: ' . $storefront_theme_mods['button_alt_text_color'] . '; + } + + .wc-block-components-button:not(.is-link):hover, + .wc-block-components-button:not(.is-link):focus, + .wc-block-components-button:not(.is-link):active { + background-color: ' . storefront_adjust_color_brightness( $storefront_theme_mods['button_alt_background_color'], $darken_factor ) . '; + color: ' . $storefront_theme_mods['button_alt_text_color'] . '; + } + + .wc-block-components-button:not(.is-link):disabled { + background-color: ' . $storefront_theme_mods['button_alt_background_color'] . '; + color: ' . $storefront_theme_mods['button_alt_text_color'] . '; + } + + .wc-block-cart__submit-container { + background-color: ' . $storefront_theme_mods['background_color'] . '; + } + + .wc-block-cart__submit-container::before { + color: ' . storefront_adjust_color_brightness( $storefront_theme_mods['background_color'], is_color_light( $storefront_theme_mods['background_color'] ) ? -35 : 70, 0.5 ) . '; + } + + .wc-block-components-order-summary-item__quantity { + background-color: ' . $storefront_theme_mods['background_color'] . '; + border-color: ' . $storefront_theme_mods['text_color'] . '; + box-shadow: 0 0 0 2px ' . $storefront_theme_mods['background_color'] . '; + color: ' . $storefront_theme_mods['text_color'] . '; + } '; return apply_filters( 'storefront_gutenberg_customizer_css', $styles );