Selaa lähdekoodia

Coutoire: Reduce specificity on rules to hide extra color palettes

Allan Cole 4 vuotta sitten
vanhempi
commit
ca9bb138ba
1 muutettua tiedostoa jossa 10 lisäystä ja 0 poistoa
  1. 10 0
      coutoire/functions.php

+ 10 - 0
coutoire/functions.php

@@ -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' );