Add classNames / extendability to GlobalStyle components for Dimensions, Border, and Background #68630
Labels
[Feature] Extensibility
The ability to extend blocks or the editing experience
[Feature] Inspector Controls
The interface showing block settings and the controls available for each block
[Type] Enhancement
A suggestion for improvement.
What problem does this address?
Currently, there is no clear selector or slot fill to extend the BlockStyle components for Dimensions, Border, and Background at the GlobalStyle settings level.
This makes it difficult to add additional styling or specific customizations seamlessly within the existing framework.
In contrast to the GlobalStyle components, the components used on Single BlockStyle Settings (e.g., for margin and padding under Dimensions) already have class names that distinguish them. These class names make it easier to identify and target these components for further customization, such as injecting React Portals. However, the absence of such class names on the GlobalStyle components prevents similar flexibility.
What is your proposed solution?
Introduce the following enhancements:
Assign unique class names to the Dimensions, Border, and Background components under GlobalStyle, similar to how the BlockEditor components implement them. See PR:
Added missing classNames on global-styles ToolsPanels #68478
Provide a clear selector or mechanism to allow developers to target and extend these components consistently.
These improvements would bring GlobalStyle components in line with the BlockEditor components in terms of extensibility and ease of customization.
Use case
I am currently implementing a responsive-control button for the Dimensions, Border, and Background components. To achieve this, I need a clear selector to extend these components and integrate a React Portal.
Here is a playground instance of how this is already working at the level of an individual block:
https://quantum-press.com/en/playground/
(You need to select a block and check its style settings)
Having a similar mechanism at the GlobalStyle level would enable the same level of extensibility and customization.
The text was updated successfully, but these errors were encountered: