Browse Source

Leven: Fix bg-color for outline styles to match frontend limitations.

Allan Cole 5 năm trước cách đây
mục cha
commit
5a1e09a29d
2 tập tin đã thay đổi với 13 bổ sung9 xóa
  1. 6 8
      leven/inc/wpcom-colors.php
  2. 7 1
      leven/inc/wpcom-editor-colors.php

+ 6 - 8
leven/inc/wpcom-colors.php

@@ -22,12 +22,12 @@ add_color_rule( 'bg', '#f7f7f6', array(
 			.wp-block-button__link,
 			.wp-block-file__button,
 			.a8c-posts-list__view-all,
-			.wp-block-button:not(.is-style-outline) a.wp-block-button__link,
-			.wp-block-button:not(.is-style-outline) .wp-block-button__link,
-			.wp-block-button:not(.is-style-outline) .wp-block-button__link:active,
-			.wp-block-button:not(.is-style-outline) .wp-block-button__link:focus,
-			.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover,
-			.wp-block-button:not(.is-style-outline) .wp-block-button__link:visited,
+			.wp-block-button:not(.is-style-outline) a.wp-block-button__link:not(.has-text-color),
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color),
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color):active,
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color):focus,
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color):hover,
+			.wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color):visited,
 			body .widget_eu_cookie_law_widget #eu-cookie-law.negative,
 			body .widget_eu_cookie_law_widget #eu-cookie-law input.accept,
 			.wp-block-cover-image:not([class*="background-color"]) .wp-block-cover-image-text,
@@ -128,10 +128,8 @@ add_color_rule( 'link', '#ff302c', array(
 	// Text-color
 	array( '.site-title a:hover,
 			.social-navigation a,
-			.wp-block-button.is-style-outline .wp-block-button__link,
 			.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,
 			.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,

+ 7 - 1
leven/inc/wpcom-editor-colors.php

@@ -12,7 +12,7 @@ add_editor_color_rule( 'bg', '#f7f7f6', array(
 
 	// Text-color
 	array( '#editor .editor-styles-wrapper .wp-block-button__link:not(.has-text-color),
-			#editor .editor-styles-wrapper .wp-block-button .wp-block-button__link:not(.has-text-color),
+			#editor .editor-styles-wrapper .wp-block-button:not(.is-style-outline) .wp-block-button__link:not(.has-text-color),
 			#editor .editor-styles-wrapper .wp-block-cover,
 			#editor .editor-styles-wrapper .wp-block-cover-image,
 			#editor .editor-styles-wrapper .wp-block-cover-image:not([class*="background-color"]) .block-editor-block-list__block,
@@ -259,6 +259,12 @@ add_editor_color_rule( 'fg1', '#1285ce', array(
  * Custom CSS
  */
 function leven_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-text-color a,
 	#editor .editor-styles-wrapper .has-background a {
 		color: currentColor;