Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Heading and paragraph colors not applied inside the cover block #17728

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions packages/block-library/src/cover/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@
h2,
.wp-block-cover-image-text,
.wp-block-cover-text {
color: $white;
font-size: 2em;
line-height: 1.25;
z-index: 1;
margin-bottom: 0;
max-width: $content-width;
padding: $block-padding;
text-align: center;
}

h2:not(.has-text-color),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to this #17704, why do we need to style h2? I guess this is not needed anymore right? (all the h2 references in this file). For example, you'll notice that it's impossible to "left align" and h2 inside a Cover.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, @youknowriad, I answered this subject at #17704 (comment).
I think we should address it in a different PR.

.wp-block-cover-image-text,
.wp-block-cover-text {
color: $white;
a,
a:hover,
a:focus,
Expand Down Expand Up @@ -130,7 +134,9 @@
h5,
h6,
.wp-block-subhead {
color: inherit;
&:not(.has-text-color) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really important, but shouldn't this just be .wp-block-subhead:not(.has-text-color)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so we also want to have selector p:not(.has-text-color) and h1:not(.has-text-color) etc... Having the selectors nested in this way ensures we apply the rule to all the selectors (not just .wp-block-subhead) that don't have a text color.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, whoops. I misread the SCSS. 😛

color: inherit;
}
}
}

Expand Down