Skip to content

Responsive editing: viewport style changes stack on top of general styles instead of overriding them #80944

Description

@jobthomas

What problem does this address?

While testing Responsive editing (WordPress 7.1 Beta 4), viewport-specific style changes appear to be applied on top of the general (default) block styles rather than overriding them.

Concretely: after enabling Responsive editing via the device preview dropdown and changing the "orientation" control for a specific viewport, the block's text rendered upside down. The viewport orientation value combined with the base value instead of replacing it.

Expected behaviour

A style set for a specific viewport should override the general style for that property at that viewport — not stack additively on top of it.

Steps to reproduce

  1. Enable Responsive editing from the device preview dropdown.
  2. Select a block that supports the orientation style.
  3. Change the orientation for a specific viewport.
  4. Observe the text renders upside down — the base and viewport values combine rather than the viewport value overriding.

Environment

Image

The cause for the above is that both orientation styles are selected for this block: one in the general view (so for every site), one on the responsive editing. However, in the responsive view only, it's not visible that this is the case, it just looks like upside down text. I can fix it by first updating the general approach, and then editing the orientation in desktop view, but it feels very counterintuitive to do so since the exception I want here is on mobile.

Part of it seems to be the fact that the UI gives the idea you're starting with a blank slate when adding a responsive layer, but you're not, you're inheriting existing styles.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Style StatesRelated to block style states (currently viewport and pseudo-states)[Status] Needs More InfoFollow-up required in order to be actionable.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions