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

Cover image as featured image + "Fixed background" duplicates the style element. #43092

Closed
Gierand opened this issue Aug 9, 2022 · 3 comments
Labels
[Block] Cover Affects the Cover Block - used to display content laid over a background image [Type] Bug An existing feature does not function as intended

Comments

@Gierand
Copy link

Gierand commented Aug 9, 2022

Description

Adding a cover image as featured image with the "Fixed background" option duplicates the style element, which will result in the following code on the frontend:

<div class="wp-block-cover is-light has-parallax" style="background-image:url(PATH_TO_IMAGE);" style="margin-top:111px">

Step-by-step reproduction instructions

  1. Create a new post.
  2. Add featured image.
  3. Add cover block as featured image.
  4. In Media settings check "Fixed background".
  5. Add any custom styles (margin or padding).

Screenshots, screen recording, code snippet

No response

Environment info

WordPress version: 6.0.1 and 6.1-alpha-53771
Gutenberg version: 13.8.1 and 13.9.20220808
Theme: TT2

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@Mamaduka Mamaduka added the [Block] Cover Affects the Cover Block - used to display content laid over a background image label Aug 9, 2022
@draganescu
Copy link
Contributor

draganescu commented Aug 16, 2022

This is where the solution in #42128 shines and the discussion in #42485 is a turning point for this: having one way to handle block rendering (with a tokenizer or not) would prevent these mistakes.

Also: tested and confirmed the bug. Wish I'd have tested this earlier :)

@draganescu draganescu added the [Type] Bug An existing feature does not function as intended label Aug 16, 2022
@akasunil
Copy link
Member

Cant regenerate it now. I believe this issue is resolved. @draganescu Can we close this issue ?

@draganescu
Copy link
Contributor

@sunil25393 I can't repro this either. @Gierand I'll close this but feel free to reopen if the problem persist for you.

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 [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants