Skip to content

BoxControlVisualizer: Create a new separate component, and fix existing issues #40057

@apeatling

Description

@apeatling

What problem does this address?

We'd like to add more visual feedback on the canvas when using Gutenberg design tools. Here's an example of how the existing BoxControlVisualizer can be used to display padding on an element on the cavas:

Screen Shot 2022-04-05 at 1 52 10 PM

Currently the BoxControlVisualizer is in an unusable state and is turned off. It's also tied closely with the BoxControl component. Some of the recently highlighted issues include:

What is your proposed solution?

I think we should:

  • Extract the BoxControlVisualizer into its own component so we can convert to TypeScript, add tests, and develop and review it in isolation.
  • Modify the visualizer so that it uses popover or :before :after styles so that we aren't adding a bunch of wrapper markup to the DOM to support it.
  • Look at using state instead of block attributes to support the new component.
  • Test this new visualizer component with a different design tool, perhaps block gap.

Metadata

Metadata

Assignees

Labels

[Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Type] EnhancementA suggestion for improvement.

Type

No type

Projects

Status

✅ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions