Explorar o código

Add full Gutenberg colors support.

Caroline Moore %!s(int64=6) %!d(string=hai) anos
pai
achega
1919884e00
Modificáronse 2 ficheiros con 43 adicións e 2 borrados
  1. 2 2
      illustratr/blocks.css
  2. 41 0
      illustratr/functions.php

+ 2 - 2
illustratr/blocks.css

@@ -533,14 +533,14 @@ hr.wp-block-separator {
 .has-dark-red-color:hover,
 .has-dark-red-color:focus,
 .has-dark-red-color:active {
-	color: #0c8384;
+	color: #b44738;
 }
 
 .has-dark-red-background-color,
 .has-dark-red-background-color:hover,
 .has-dark-red-background-color:focus,
 .has-dark-red-background-color:active {
-	background-color: #0c8384;
+	background-color: #b44738;
 }
 
 .has-black-color,

+ 41 - 0
illustratr/functions.php

@@ -65,6 +65,47 @@ function illustratr_setup() {
 	 */
 	add_theme_support( 'responsive-embeds' );
 
+	// Add custom colors to Gutenberg
+	add_theme_support(
+		'editor-color-palette', array(
+			array(
+				'name'  => esc_html__( 'Black', 'illustratr' ),
+				'slug' => 'black',
+				'color' => '#24282d',
+			),
+			array(
+				'name'  => esc_html__( 'Dark Gray', 'illustratr' ),
+				'slug' => 'dark-gray',
+				'color' => '#464d4d',
+			),
+			array(
+				'name'  => esc_html__( 'Medium Gray', 'illustratr' ),
+				'slug' => 'medium-gray',
+				'color' => '#7f8d8c',
+			),
+			array(
+				'name'  => esc_html__( 'Light Gray', 'illustratr' ),
+				'slug' => 'light-gray',
+				'color' => '#f1f2f3',
+			),
+			array(
+				'name'  => esc_html__( 'White', 'illustratr' ),
+				'slug' => 'white',
+				'color' => '#ffffff',
+			),
+			array(
+				'name'  => esc_html__( 'Red', 'illustratr' ),
+				'slug' => 'red',
+				'color' => '#e06d5e',
+			),
+			array(
+				'name'  => esc_html__( 'Dark Red', 'illustratr' ),
+				'slug' => 'dark-red',
+				'color' => '#b44738',
+			)
+		)
+	);
+
 	/*
 	 * Enable support for Post Thumbnails on posts and pages.
 	 *