-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
We use the re-resizable package for resizable boxes with drag handles.
Currently it's used in core/image and core/spacer and potentially in #9416 and similar future improvements.
Because of the way it's been implemented, each block that uses it uses their own CSS classes for the spacer handles, e.g. block-library-spacer__resize-handler-bottom and block-library-image__resize-handler-bottom. That means the CSS itself is duplicated too in the final bundle.
We also have to unset a bunch of inline styles on the parent component each time we use it (see #10331).
As a consequence, it might be good to wrap ResizableBox in our own component which eliminates the CSS duplication with global resize handle classes/styles and simplifies some of the currently duplicative code (particularly the handleClasses and handleStyles props).
My main question is where this would belong… @wordpress/components, @wordpress/editor, or somewhere else entirely?
(cc @tofumatt)