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

Fixes #38761 by removing obsolete ::before pseudo element #38762

Merged
merged 1 commit into from Feb 25, 2022

Conversation

webmandesign
Copy link
Contributor

Description

Fixes #38761 by removing obsolete span::before pseudo element.

Types of changes

Bug fix (non-breaking change which fixes an issue)

@skorasaurus skorasaurus added [Block] Cover Affects the Cover Block - used to display content laid over a background image CSS Styling Related to editor and front end styles, CSS-specific issues. labels Feb 12, 2022
@ramonjd
Copy link
Member

ramonjd commented Feb 22, 2022

Thanks for submitting this patch @webmandesign 🙇

I've tested and I'm fairly convinced the deleted rule isn't required. I would probably want to get a confidence check from @WunderBart who introduced it to fix a regression.

Balancing new features with backwards compatibility support is not easy.

It's part of the reason why older CSS rules are still in play.

So, if a site updates to a later version of Gutenberg – one that does not support the ::before pseudo-element – the site still may have posts with Cover Blocks that have been saved previously, with the older markup.

The older markup therefore still requires the corresponding, older styles so that it looks decent in the frontend.

However, I can't find a case in the deprecations where .has-background-dim::before is required for the reasons you mentioned in #38761 Previously.has-background-dim featured on the container element, hence the need for &.has-background-dim::before.

<div class="wp-block-cover has-background-dim" ...

but it'd still be good to get the 👌 from @WunderBart

@webmandesign
Copy link
Contributor Author

FYI, I've tested this with WP 5.8.3 and WP 5.9 (where the HTML has been updated). Tried many different Cover block displays but surely I might have missed something - don't know what I don't know ;) From my perspective the fix should be backwards compatible.

@webmandesign
Copy link
Contributor Author

webmandesign commented Feb 22, 2022

Some more info I've found: the code I've removed was introduced in #36312

@Mamaduka Mamaduka added the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Feb 22, 2022
@ramonjd
Copy link
Member

I might have missed something - don't know what I don't know

I know what you mean. 😄 In my testing the changes seem innocuous, and should be fine to merge, but I'd feel more confident after confirmation.

@webmandesign
Copy link
Contributor Author

Some more info:
I checked if there was any WordPress release with the #36312 code and have found none.

The code was introduced on Nov 8, 2021 and there were WordPress 5.8.2 and 5.8.3 releases since. None of them contains the code, so it was not used in the wild (unless Gutenberg plugin is used on the website, which I understand would be more for testing purposes and is not recommended for live websites?).

Also according to https://developer.wordpress.org/block-editor/contributors/versions-in-wordpress/ it seems WP5.8 contained Gutenberg 10.7(.?), while the code was introduced in Gutenberg 11.8.2.

But I can see WordPress 5.9.1 was already released so unfortunately I have to wait for some future WP version to fix this. Meanwhile I've applied the code fixing this into my themes.

Copy link
Member

@ramonjd ramonjd left a comment

Choose a reason for hiding this comment

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

I checked if there was any WordPress release with the #36312 code and have found none.

Thanks for the thorough checking! I think we can approve for now.

I'll leave it unmerged overnight just in case we get any feedback, then come back to push the button tomorrow. 👍

@ramonjd ramonjd merged commit 0332bb9 into WordPress:trunk Feb 25, 2022
@github-actions github-actions bot added this to the Gutenberg 12.8 milestone Feb 25, 2022
@Mamaduka Mamaduka removed the Backport to WP Minor Release Pull request that needs to be backported to a WordPress minor release label Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image CSS Styling Related to editor and front end styles, CSS-specific issues.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cover block overlay is duplicated on redundant ::before
4 participants