Skip to content

Responsive visibility does not work for blocks without a wrapper tag, such as custom HTML blocks. #76128

@shimotmk

Description

@shimotmk

Description

The responsive hide feature uses media queries. If there is no wrapper tag, the class is not added, and the hide CSS will not be applied.

A support flag like

"visibility": {
  "viewport": false
}

might be necessary in block.json's supports property.

This feature will be introduced from WordPress 7.0, so a backport might be necessary.

Step-by-step reproduction instructions

  1. Go to post or page.
  2. Insert custom html block.
  3. Hide on Desktop
  4. You will see that the content of the custom HTML block is displayed on desktop as well.

Screenshots, screen recording, code snippet

visible.mp4

Environment info

  • WordPress beta 2

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

Assignees

Labels

[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions