Skip to content

Spacing is cleared when editing block styles #112

@g-elwell

Description

@g-elwell

Expected Behavior

When navigating through the UI and editing different styles, no changes should be made unless specifically updated by a user.

Actual Behavior

When navigating to a block with spacing set in the theme.json, the styles update to clear the spacing.

Step-by-step reproduction instructions

  1. Set theme to Twenty Twenty Four
  2. Activate Themer
  3. Go to Appearance > Styles Editor
  4. Navigate to Blocks > Quote
  5. Notice the quote block will update to remove existing spacing values

Screenshots, screen recordings, code snippets

This is noticeable in the visual preview from #111 and less obvious when viewing the 'code preview'. However, note that the original spacing in theme.json is:

"spacing": {
  "padding": {
    "bottom": "calc(var(--wp--preset--spacing--30) + 0.75rem)",
    "left": "calc(var(--wp--preset--spacing--30) + 0.75rem)",
    "right": "calc(var(--wp--preset--spacing--30) + 0.75rem)",
    "top": "calc(var(--wp--preset--spacing--30) + 0.75rem)"
  }
},

But when navigating to the Quote block, the styles will show:

"spacing": {
  "padding": {
    "bottom": "0px",
    "left": "0px",
    "right": "0px",
    "top": "0px"
  }
}
Screen.Capture.on.2024-10-02.at.09-32-17.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions