mirror of
https://github.com/woocommerce/storefront.git
synced 2025-08-21 04:11:59 +08:00
Stop theme defaults from overriding the Featured Item blocks text color (#2039)
* Add docblocks to hooks used in customizer class. This resolves PHP linting errors. * 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. * 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`. * Remove/resolve items from merge conflict.
This commit is contained in:
parent
7c32db4450
commit
a21262ecbf
1 changed files with 7 additions and 1 deletions
|
@ -1246,9 +1246,15 @@ if ( ! class_exists( 'Storefront_Customizer' ) ) :
|
|||
/* 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(: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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue