Skip to content

Additional CSS inside Query Loop is inserted multiple times #78278

@benniledl

Description

@benniledl

Description

When using the new Additional CSS feature on a block inside a Query Loop, the generated CSS is inserted once for every rendered post/item in the loop.

This causes the same CSS rules to be duplicated N times, where N equals the number of posts rendered by the Query Loop.

Step-by-step reproduction instructions

Open the site editor.

Add a Query Loop block.

Inside the Query Loop template, select a block, for example:
Post Title
Add custom CSS using the block’s Additional CSS panel.

Save the template.

Publish a few posts.

View the frontend.

Inspect the styles applied to this block

Screenshots, screen recording, code snippet

Image Image

Environment info

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

Status
🏗️ In Progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions