Skip to content

Add option to hide blocks based on screen size #72502

@annezazu

Description

@annezazu

With the ability to hide blocks coming to 6.9, this issue is to discuss what comes next. Previously, adding the ability to hide a block based on screen size has come up as a requested feature and something to explore in this current issue:

There are plugin tools like "block visibility" that can bridge some of those gaps until we have the space and bandwidth to do something in core that can be sustainable. For example, one idea that has been discussed a few times is allowing edits done while viewing "mobile" to be applied to that breakpoint alone. The amount of edits you can do would be naturally limited to things that are expressive (for example, removing a block could become "hide this block" when in that context). It could be an option to explore.

Hiding a block based on screen size has also come up in Responsive previewing and device-specific editing. To keep this in an actionable state, let's use this issue to discuss building upon hiding blocks for additional features in 7.0.

Development phases

Important

This feature will be iteratively developed behind an experimental flag to start with to minimize impact on the current editor UX.

These are high level so far. We have designs and the following proof of concept PRs as reference material:

Phases and tasks for 7.0

Tasks are tracked on the WordPress 7.0 planning task.

Beyond 7.0

Speculative tasks for future releases.

  • configurable breakpoints (in theme.json and eventually in the UI)
  • extend visibility rules to other criteria, e.g., user roles or time. See Add option to hide blocks based on screen size #72502 (comment)
  • centralization of breakpoint/device logic across WordPress packages (currently disparate)
  • centralization of currently-hidden blocks somewhere the UI with toggle/reset controls
  • extend style engine, where appropriate, to handle the display property and related logic

Related, and sorta related issues

Metadata

Metadata

Assignees

Labels

Needs Design FeedbackNeeds general design feedback.[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] EnhancementA suggestion for improvement.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions