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

Group block: multiple wp-container-* classes and duplicate styles per block #33005

Closed
chthonic-ds opened this issue Jun 26, 2021 · 0 comments · Fixed by #33045
Closed

Group block: multiple wp-container-* classes and duplicate styles per block #33005

chthonic-ds opened this issue Jun 26, 2021 · 0 comments · Fixed by #33045
Assignees
Labels
[Block] Group Affects the Group Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended

Comments

@chthonic-ds
Copy link
Contributor

chthonic-ds commented Jun 26, 2021

Description

A wp-container-* class is added to a Group block's parent container, with a <style> element inserted after the block markup to help scope layout settings. I notice a second class is also added for no obvious benefit. This results in two separate but duplicate style elements being inserted per block.

Step-by-step reproduction instructions

  1. Add a new Group block.
  2. In the Block settings panel set Layout > Inherit default layout.
  3. Save and visit the front-end page to inspect the source.
  4. Notice two layout-related wp-container-* classes have been added to the parent container. Two corresponding style tags have also been added after the block markup.

Expected behaviour

Presuming this is not intentional, I expect to see a single class added to the block container, along with a single corresponding <style> block.

Actual behaviour

Two different classes are added to the block container along with two duplicate <style> blocks.

Screenshots or screen recording (optional)

theme-json-layout-settings-duplicate-style-blocks

WordPress information

  • WordPress version: 5.8-beta4 but have observed in earlier versions
  • Gutenberg version: 10.9.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? Tested with TT1 Blocks, screenshot from a different theme

Device information

  • Device: Desktop
  • Operating system: Windows 10
  • Browser: Chrome 91.0.4472.114
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Group Affects the Group Block [Status] In Progress Tracking issues with work in progress [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants