From 315616aa5ed76c12d35d9f6fe40dd179c93d430d Mon Sep 17 00:00:00 2001
From: allancole <allancole@git.wordpress.org>
Date: Thu, 7 Mar 2019 22:36:58 +0000
Subject: [PATCH] Twenty Nineteen: Improve custom color behavior for
 InnerBlocks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, if a parent block has a custom background color assigned, its child blocks will inherit the parent's text colors — even if the child block has its own custom text color assigned to it.

This update changes the following:

- Adjusts Twenty Nineteen's custom background color defaults to target direct children only which fixes the issue

Props kjellr.

See #46432.



git-svn-id: https://develop.svn.wordpress.org/trunk@44818 602fd350-edb4-49c9-b593-d223f7449a82
---
 .../twentynineteen/sass/blocks/_blocks.scss   | 40 ++++-----
 .../themes/twentynineteen/style-rtl.css       | 88 +++++++++----------
 .../themes/twentynineteen/style.css           | 88 +++++++++----------
 3 files changed, 108 insertions(+), 108 deletions(-)

diff --git a/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss b/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
index 479ee33d25..653e50a8c2 100644
--- a/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
+++ b/src/wp-content/themes/twentynineteen/sass/blocks/_blocks.scss
@@ -838,14 +838,14 @@
 		// Use white text against these backgrounds by default.
 		color: $color__background-body;
 
-		p,
-		h1,
-		h2,
-		h3,
-		h4,
-		h5,
-		h6,
-		a {
+		> p,
+		> h1,
+		> h2,
+		> h3,
+		> h4,
+		> h5,
+		> h6,
+		> a {
 			color: $color__background-body;
 		}
 	}
@@ -854,14 +854,14 @@
 		color: $color__text-main;
 
 		// Use dark gray text against this background by default.
-		p,
-		h1,
-		h2,
-		h3,
-		h4,
-		h5,
-		h6,
-		a {
+		> p,
+		> h1,
+		> h2,
+		> h3,
+		> h4,
+		> h5,
+		> h6,
+		> a {
 			color: $color__text-main;
 		}
 	}
@@ -894,25 +894,25 @@
 	//! Custom foreground colors
 	.has-primary-color,
 	.wp-block-pullquote.is-style-solid-color blockquote.has-primary-color,
-	.wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p {
+	.wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p {
 		color: $color__link;
 	}
 
 	.has-secondary-color,
 	.wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color,
-	.wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p {
+	.wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p {
 		color: $color__border-link-hover;
 	}
 
 	.has-dark-gray-color,
 	.wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color,
-	.wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p {
+	.wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p {
 		color: $color__text-main;
 	}
 
 	.has-light-gray-color,
 	.wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color,
-	.wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p {
+	.wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p {
 		color: $color__text-light;
 	}
 
diff --git a/src/wp-content/themes/twentynineteen/style-rtl.css b/src/wp-content/themes/twentynineteen/style-rtl.css
index 80732eb901..3fd6f91ecd 100644
--- a/src/wp-content/themes/twentynineteen/style-rtl.css
+++ b/src/wp-content/themes/twentynineteen/style-rtl.css
@@ -6075,38 +6075,38 @@ body.page .main-navigation {
   color: #fff;
 }
 
-.entry .entry-content .has-primary-background-color p,
-.entry .entry-content .has-primary-background-color h1,
-.entry .entry-content .has-primary-background-color h2,
-.entry .entry-content .has-primary-background-color h3,
-.entry .entry-content .has-primary-background-color h4,
-.entry .entry-content .has-primary-background-color h5,
-.entry .entry-content .has-primary-background-color h6,
-.entry .entry-content .has-primary-background-color a,
-.entry .entry-content .has-secondary-background-color p,
-.entry .entry-content .has-secondary-background-color h1,
-.entry .entry-content .has-secondary-background-color h2,
-.entry .entry-content .has-secondary-background-color h3,
-.entry .entry-content .has-secondary-background-color h4,
-.entry .entry-content .has-secondary-background-color h5,
-.entry .entry-content .has-secondary-background-color h6,
-.entry .entry-content .has-secondary-background-color a,
-.entry .entry-content .has-dark-gray-background-color p,
-.entry .entry-content .has-dark-gray-background-color h1,
-.entry .entry-content .has-dark-gray-background-color h2,
-.entry .entry-content .has-dark-gray-background-color h3,
-.entry .entry-content .has-dark-gray-background-color h4,
-.entry .entry-content .has-dark-gray-background-color h5,
-.entry .entry-content .has-dark-gray-background-color h6,
-.entry .entry-content .has-dark-gray-background-color a,
-.entry .entry-content .has-light-gray-background-color p,
-.entry .entry-content .has-light-gray-background-color h1,
-.entry .entry-content .has-light-gray-background-color h2,
-.entry .entry-content .has-light-gray-background-color h3,
-.entry .entry-content .has-light-gray-background-color h4,
-.entry .entry-content .has-light-gray-background-color h5,
-.entry .entry-content .has-light-gray-background-color h6,
-.entry .entry-content .has-light-gray-background-color a {
+.entry .entry-content .has-primary-background-color > p,
+.entry .entry-content .has-primary-background-color > h1,
+.entry .entry-content .has-primary-background-color > h2,
+.entry .entry-content .has-primary-background-color > h3,
+.entry .entry-content .has-primary-background-color > h4,
+.entry .entry-content .has-primary-background-color > h5,
+.entry .entry-content .has-primary-background-color > h6,
+.entry .entry-content .has-primary-background-color > a,
+.entry .entry-content .has-secondary-background-color > p,
+.entry .entry-content .has-secondary-background-color > h1,
+.entry .entry-content .has-secondary-background-color > h2,
+.entry .entry-content .has-secondary-background-color > h3,
+.entry .entry-content .has-secondary-background-color > h4,
+.entry .entry-content .has-secondary-background-color > h5,
+.entry .entry-content .has-secondary-background-color > h6,
+.entry .entry-content .has-secondary-background-color > a,
+.entry .entry-content .has-dark-gray-background-color > p,
+.entry .entry-content .has-dark-gray-background-color > h1,
+.entry .entry-content .has-dark-gray-background-color > h2,
+.entry .entry-content .has-dark-gray-background-color > h3,
+.entry .entry-content .has-dark-gray-background-color > h4,
+.entry .entry-content .has-dark-gray-background-color > h5,
+.entry .entry-content .has-dark-gray-background-color > h6,
+.entry .entry-content .has-dark-gray-background-color > a,
+.entry .entry-content .has-light-gray-background-color > p,
+.entry .entry-content .has-light-gray-background-color > h1,
+.entry .entry-content .has-light-gray-background-color > h2,
+.entry .entry-content .has-light-gray-background-color > h3,
+.entry .entry-content .has-light-gray-background-color > h4,
+.entry .entry-content .has-light-gray-background-color > h5,
+.entry .entry-content .has-light-gray-background-color > h6,
+.entry .entry-content .has-light-gray-background-color > a {
   color: #fff;
 }
 
@@ -6114,14 +6114,14 @@ body.page .main-navigation {
   color: #111;
 }
 
-.entry .entry-content .has-white-background-color p,
-.entry .entry-content .has-white-background-color h1,
-.entry .entry-content .has-white-background-color h2,
-.entry .entry-content .has-white-background-color h3,
-.entry .entry-content .has-white-background-color h4,
-.entry .entry-content .has-white-background-color h5,
-.entry .entry-content .has-white-background-color h6,
-.entry .entry-content .has-white-background-color a {
+.entry .entry-content .has-white-background-color > p,
+.entry .entry-content .has-white-background-color > h1,
+.entry .entry-content .has-white-background-color > h2,
+.entry .entry-content .has-white-background-color > h3,
+.entry .entry-content .has-white-background-color > h4,
+.entry .entry-content .has-white-background-color > h5,
+.entry .entry-content .has-white-background-color > h6,
+.entry .entry-content .has-white-background-color > a {
   color: #111;
 }
 
@@ -6152,25 +6152,25 @@ body.page .main-navigation {
 
 .entry .entry-content .has-primary-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p {
   color: #0073aa;
 }
 
 .entry .entry-content .has-secondary-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p {
   color: #005177;
 }
 
 .entry .entry-content .has-dark-gray-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p {
   color: #111;
 }
 
 .entry .entry-content .has-light-gray-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p {
   color: #767676;
 }
 
diff --git a/src/wp-content/themes/twentynineteen/style.css b/src/wp-content/themes/twentynineteen/style.css
index 0185b404e5..ac596fab23 100644
--- a/src/wp-content/themes/twentynineteen/style.css
+++ b/src/wp-content/themes/twentynineteen/style.css
@@ -6087,38 +6087,38 @@ body.page .main-navigation {
   color: #fff;
 }
 
-.entry .entry-content .has-primary-background-color p,
-.entry .entry-content .has-primary-background-color h1,
-.entry .entry-content .has-primary-background-color h2,
-.entry .entry-content .has-primary-background-color h3,
-.entry .entry-content .has-primary-background-color h4,
-.entry .entry-content .has-primary-background-color h5,
-.entry .entry-content .has-primary-background-color h6,
-.entry .entry-content .has-primary-background-color a,
-.entry .entry-content .has-secondary-background-color p,
-.entry .entry-content .has-secondary-background-color h1,
-.entry .entry-content .has-secondary-background-color h2,
-.entry .entry-content .has-secondary-background-color h3,
-.entry .entry-content .has-secondary-background-color h4,
-.entry .entry-content .has-secondary-background-color h5,
-.entry .entry-content .has-secondary-background-color h6,
-.entry .entry-content .has-secondary-background-color a,
-.entry .entry-content .has-dark-gray-background-color p,
-.entry .entry-content .has-dark-gray-background-color h1,
-.entry .entry-content .has-dark-gray-background-color h2,
-.entry .entry-content .has-dark-gray-background-color h3,
-.entry .entry-content .has-dark-gray-background-color h4,
-.entry .entry-content .has-dark-gray-background-color h5,
-.entry .entry-content .has-dark-gray-background-color h6,
-.entry .entry-content .has-dark-gray-background-color a,
-.entry .entry-content .has-light-gray-background-color p,
-.entry .entry-content .has-light-gray-background-color h1,
-.entry .entry-content .has-light-gray-background-color h2,
-.entry .entry-content .has-light-gray-background-color h3,
-.entry .entry-content .has-light-gray-background-color h4,
-.entry .entry-content .has-light-gray-background-color h5,
-.entry .entry-content .has-light-gray-background-color h6,
-.entry .entry-content .has-light-gray-background-color a {
+.entry .entry-content .has-primary-background-color > p,
+.entry .entry-content .has-primary-background-color > h1,
+.entry .entry-content .has-primary-background-color > h2,
+.entry .entry-content .has-primary-background-color > h3,
+.entry .entry-content .has-primary-background-color > h4,
+.entry .entry-content .has-primary-background-color > h5,
+.entry .entry-content .has-primary-background-color > h6,
+.entry .entry-content .has-primary-background-color > a,
+.entry .entry-content .has-secondary-background-color > p,
+.entry .entry-content .has-secondary-background-color > h1,
+.entry .entry-content .has-secondary-background-color > h2,
+.entry .entry-content .has-secondary-background-color > h3,
+.entry .entry-content .has-secondary-background-color > h4,
+.entry .entry-content .has-secondary-background-color > h5,
+.entry .entry-content .has-secondary-background-color > h6,
+.entry .entry-content .has-secondary-background-color > a,
+.entry .entry-content .has-dark-gray-background-color > p,
+.entry .entry-content .has-dark-gray-background-color > h1,
+.entry .entry-content .has-dark-gray-background-color > h2,
+.entry .entry-content .has-dark-gray-background-color > h3,
+.entry .entry-content .has-dark-gray-background-color > h4,
+.entry .entry-content .has-dark-gray-background-color > h5,
+.entry .entry-content .has-dark-gray-background-color > h6,
+.entry .entry-content .has-dark-gray-background-color > a,
+.entry .entry-content .has-light-gray-background-color > p,
+.entry .entry-content .has-light-gray-background-color > h1,
+.entry .entry-content .has-light-gray-background-color > h2,
+.entry .entry-content .has-light-gray-background-color > h3,
+.entry .entry-content .has-light-gray-background-color > h4,
+.entry .entry-content .has-light-gray-background-color > h5,
+.entry .entry-content .has-light-gray-background-color > h6,
+.entry .entry-content .has-light-gray-background-color > a {
   color: #fff;
 }
 
@@ -6126,14 +6126,14 @@ body.page .main-navigation {
   color: #111;
 }
 
-.entry .entry-content .has-white-background-color p,
-.entry .entry-content .has-white-background-color h1,
-.entry .entry-content .has-white-background-color h2,
-.entry .entry-content .has-white-background-color h3,
-.entry .entry-content .has-white-background-color h4,
-.entry .entry-content .has-white-background-color h5,
-.entry .entry-content .has-white-background-color h6,
-.entry .entry-content .has-white-background-color a {
+.entry .entry-content .has-white-background-color > p,
+.entry .entry-content .has-white-background-color > h1,
+.entry .entry-content .has-white-background-color > h2,
+.entry .entry-content .has-white-background-color > h3,
+.entry .entry-content .has-white-background-color > h4,
+.entry .entry-content .has-white-background-color > h5,
+.entry .entry-content .has-white-background-color > h6,
+.entry .entry-content .has-white-background-color > a {
   color: #111;
 }
 
@@ -6164,25 +6164,25 @@ body.page .main-navigation {
 
 .entry .entry-content .has-primary-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-primary-color > p {
   color: #0073aa;
 }
 
 .entry .entry-content .has-secondary-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-secondary-color > p {
   color: #005177;
 }
 
 .entry .entry-content .has-dark-gray-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-dark-gray-color > p {
   color: #111;
 }
 
 .entry .entry-content .has-light-gray-color,
 .entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color,
-.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color p {
+.entry .entry-content .wp-block-pullquote.is-style-solid-color blockquote.has-light-gray-color > p {
   color: #767676;
 }