-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block Supports: Add panel specific className #35793
Conversation
Size Change: +10 B (0%) Total Size: 1.07 MB
ℹ️ View Unchanged
|
Tests well for dimension and border. I couldn't cleanly rebase or merge this PR on top of Color Block Support: Switch to ToolsPanel for displaying UI #34027, or the other way around unfortunately. It looks like that PR needs a rebase itself. So wasn't able to reliably test the color panel. Seeing as it's not yet merged I guess it's okay? Conceptually, I think adding specific classnames for grouped ToolsPanels is okay, seeing as there's a precedent for passing custom Is it something that we'd continue to want to do in the future? I can't tell. I don't think the desire to customize the internals of individual panels is going to go away though. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests well on for Dimensions and Border.
I can see the className on the containing div.
I couldn't test Color, but seeing as it hasn't yet been migrated to the ToolsPanel, I'm assuming it should be fine (?)
packages/block-editor/src/components/inspector-controls/block-support-tools-panel.js
Show resolved
Hide resolved
Between when #34027 was created and now a lot has changed. I have rebased it locally and am working on resolving conflicts. In particular, the Global Styles sidebar has changed plenty. It now uses an updated navigation component as well as a new approach to getting and setting global styles. The same goes for the other block support panel PRs switching to the I'm not sure that these panels in the global styles need to be updated now but I'm guessing consistency between the global styles and block editor inspector controls is still desirable. Either way, given we shouldn't target hardcoded class names directly within the
Even when our components are updated to leverage the context system and Emotion for styling, I believe there'll be value in being able to target these panels via CSS. While still experimental, soon enough, we'll be allowing controls to be injected into these block support panels via SlotFill. I can definitely see those ad hoc controls benefiting from the new class names. |
To help progress the other PRs switching the block supports to the |
Related:
Description
This adds a
className
specific to each grouped inspector controls slot. It allows different block supports to override some component styles within theToolsPanel
until those components are migrated to the new context system.How has this been tested?
Manually.
dimensions-block-support-panel
class.Screenshots
Types of changes
Enhancement.
Checklist:
*.native.js
files for terms that need renaming or removal).