-
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
Update the rules to hide/show blocks in the global styles sidebar #35178
Conversation
Size Change: +39 B (0%) Total Size: 1.06 MB
ℹ️ View Unchanged
|
For context, we removed that restriction for themes at #29941 I've just checked the styles section of a couple of themes and I see that they use the following styles for which the block doesn't declare support: TT1-blocks:
Quadrat:
|
The rationale to remove that requirement for themes was that they could experiment at a higher pace than we could add supports for the blocks. The responsibility for checking that it worked was shifted to the themes, I'm not sure it's a good thing to expose users to this burden. I'd argue the properties I've shared above should be added as block supports to the blocks at some point (even if we want to hide them by default from the user in the block sidebar). Essentially, my concern is: if we show the panels, isn't the expectation that they work? And if they don't work, isn't this a bug? |
An alternative approach is to create the panel/properties if any of this happens: the block supports the property or the theme styles the property. If the theme is styling the property, it probably works, so we could be optimistic about exposing that to users. |
I agree with this way of seeing things. I also worry about another point:
What if theme.json does not use some block supports at all but the block supports it? The user will not be able to use some customization ability that should be possible right? |
Yeah, I see the points. I'm still uncertain as well. I think I can scale this down to this to start with:
|
91d60ca
to
c7824ff
Compare
Ok, I restored the checks and only left the removal of blocks with no visible panels. This should be ready for another review. |
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.
The logic looks good, and the behavior is working well in my testing.
I activated a couple of plugins that add a ton of blocks that don't support styling, and this greatly clears up the blocks selection menu by removing them as expected!
Thanks for getting to this so quickly! 🎉
This changes the rules of whether to show the block panels in the global styles sidebar in two ways:
Edit: The second point above has been reverted (see discussion)