Balasana: Fix inconsistent text and link colors inside of group blocks with background colors

- Kudos to @kjellr
This commit is contained in:
Allan Cole 2020-07-16 18:43:17 -04:00
parent 27b3d7a387
commit ace3ce10f5
2 changed files with 20 additions and 2 deletions

View file

@ -78,7 +78,13 @@ add_color_rule( 'bg', '#FFFFFF', array(
.has-background-dark-color,
.has-background-light-color,
.has-foreground-dark-background-color,
.has-foreground-light-background-color', 'color' ),
.has-foreground-light-background-color,
.has-primary-background-color,
.has-primary-background-color.has-background-dim,
.has-secondary-background-color,
.has-secondary-background-color.has-background-dim,
.has-foreground-background-color,
.has-foreground-background-color.has-background-dim', 'color' ),
// Background-color
array( '.has-background-background-color', 'background-color' ),
// Background-color darkened

View file

@ -82,7 +82,7 @@ add_editor_color_rule( 'link', '#19744C', array(
// Text-color
array( '#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
#editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
.editor-styles-wrapper a', 'color' ),
#editor .editor-styles-wrapper a', 'color' ),
// Background-color
array( '#editor .editor-styles-wrapper .button,
@ -172,3 +172,15 @@ add_editor_color_rule( 'fg1', '#BC2213', array(
#editor .editor-styles-wrapper .wp-block .has-secondary-background-color', 'background-color' ),
), __( 'Secondary Color' ) );
/**
* Custom CSS
*/
function balasana_custom_colors_extra_css() { ?>
/* Ensure links match the front end when there's a custom background color. */
#editor .editor-styles-wrapper .wp-block .has-background:not(.has-background-background-color) a {
color: currentColor;
}
<?php }
add_theme_support( 'custom_colors_extra_css', 'balasana_custom_colors_extra_css' );