Преглед на файлове

Mayland: Fixing button color styles.

Allan Cole преди 4 години
родител
ревизия
5d0dab2b35
променени са 2 файла, в които са добавени 28 реда и са изтрити 13 реда
  1. 6 5
      mayland/inc/wpcom-colors.php
  2. 22 8
      mayland/inc/wpcom-editor-colors.php

+ 6 - 5
mayland/inc/wpcom-colors.php

@@ -16,7 +16,8 @@ add_color_rule( 'bg', '#ffffff', array(
 	array( '.a8c-posts-list-item__featured span,
 			.sticky-post,
 			.wp-block-pullquote.is-style-solid-color,
-			body .widget_eu_cookie_law_widget #eu-cookie-law.negative', 'color' ),
+			body .widget_eu_cookie_law_widget #eu-cookie-law.negative,
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color)', 'color' ),
 
 	// Background-color Lightened
 	array( '.wp-block-table.is-style-stripes tbody tr:nth-child(odd),
@@ -127,10 +128,10 @@ add_color_rule( 'link', '#000000', array(
 			.page-title a:active,
 			.page-title a:focus,
 			.page-title a:hover,
-			.wp-block-button.is-style-outline .wp-block-button__link,
-			.wp-block-button.is-style-outline .wp-block-button__link:active,
-			.wp-block-button.is-style-outline.wp-block-button__link,
-			.wp-block-button.is-style-outline.wp-block-button__link:active,
+			.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color),
+			.wp-block-button.is-style-outline .wp-block-button__link:not(.has-text-color):active,
+			.wp-block-button.is-style-outline.wp-block-button__link:not(.has-text-color),
+			.wp-block-button.is-style-outline.wp-block-button__link:not(.has-text-color):active,
 			.wp-block-newspack-blocks-homepage-articles article .entry-title a,
 			.wp-block-newspack-blocks-homepage-articles article .entry-title a:active,
 			.wp-block-newspack-blocks-homepage-articles article .entry-title a:focus,

+ 22 - 8
mayland/inc/wpcom-editor-colors.php

@@ -11,7 +11,10 @@ add_editor_color_rule( 'bg', '#ffffff', array(
 	array( '#editor .editor-styles-wrapper', 'background-color' ),
 
 	// Text-color
-	array( '#editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'color' ),
+	array( '#editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover', 'color' ),
 
 	/**
 	 * Utility Classes
@@ -70,13 +73,18 @@ add_editor_color_rule( 'link', '#000000', array(
 	// Background-color
 	array( '#editor .editor-styles-wrapper .button,
 			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button,
-			#editor .editor-styles-wrapper .wp-block-button__link,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background-color),
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-background),
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
 			#editor .editor-styles-wrapper .wp-block-pullquote.is-style-solid-color', 'background-color' ),
 
 	// Text-color
-	array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link,
-			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
+	array( '#editor .editor-styles-wrapper .wp-block-button.is-style-outline .wp-block-button__link,
 			#editor .editor-styles-wrapper .wp-block-button__link.is-style-outline,
+			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts .entry-title a,
 			#editor .editor-styles-wrapper a', 'color' ),
 
 	// Border color left
@@ -127,7 +135,8 @@ add_editor_color_rule( 'txt', '#010101', array(
 			#editor .editor-styles-wrapper .wp-block-video figcaption,
 			#editor .editor-styles-wrapper figcaption,
 			#editor .editor-styles-wrapper table.is-style-stripes tbody tr:nth-child(odd),
-			#editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd)', 'color' ),
+			#editor .editor-styles-wrapper .wp-block-table.is-style-stripes tbody tr:nth-child(odd),
+			#editor .editor-styles-wrapper .wp-block-code', 'color' ),
 
 	// Text-color brightened
 	array( '#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link.has-focus,
@@ -160,9 +169,9 @@ add_editor_color_rule( 'txt', '#010101', array(
 			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:focus,
 			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .button:hover,
 			#editor .editor-styles-wrapper .wp-block-a8c-blog-posts + .has-focus.button,
-			#editor .editor-styles-wrapper .wp-block-button__link.has-focus,
-			#editor .editor-styles-wrapper .wp-block-button__link:focus,
-			#editor .editor-styles-wrapper .wp-block-button__link:hover', 'background-color', '+2' ),
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link.has-focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:hover', 'background-color', '+2' ),
 
 	/**
 	 * Utility Classes
@@ -218,6 +227,11 @@ add_editor_color_rule( 'fg1', '#1a1a1a', array(
  * Custom CSS
  */
 function mayland_editor_custom_colors_extra_css() { ?>
+	#editor .editor-styles-wrapper .wp-block-button__link.is-style-outline.has-background[class], 
+	#editor .editor-styles-wrapper .is-style-outline .wp-block-button__link.has-background[class] {
+		background: transparent !important;
+	}
+
 	#editor .editor-styles-wrapper .has-background:not(.has-background-background-color) a:not(.wp-block-button__link),
 	#editor .editor-styles-wrapper p.has-text-color a {
 		color: currentColor;