Coutoire: Reduce specificity on rules to hide extra color palettes

This commit is contained in:
Allan Cole 2020-11-04 17:07:01 -05:00 committed by GitHub
parent 04bc8a94ee
commit ca9bb138ba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -189,6 +189,16 @@ function coutoire_editor_styles() {
// Enqueue Google fonts in the editor, if necessary
wp_enqueue_style( 'coutoire-editor-fonts', coutoire_fonts_url(), array(), null );
// Hide duplicate palette colors
$colors_array = get_theme_mod( 'colors_manager', array( 'colors' => true ) ); // color annotations array()
if ( ! empty( $colors_array ) && $colors_array['colors']['txt'] != '#767676' ) { // $config-global--color-foreground-light-default;
$inline_palette_css = '.components-circular-option-picker__option-wrapper:nth-child(5),
.components-circular-option-picker__option-wrapper:nth-child(6) {
display: none;
}';
wp_add_inline_style( 'wp-edit-blocks', $inline_palette_css );
}
}
add_action( 'enqueue_block_editor_assets', 'coutoire_editor_styles' );