-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: Make block inspector self contain its styles #17880
Update: Make block inspector self contain its styles #17880
Conversation
@@ -1,3 +1,17 @@ | |||
.block-editor-block-inspector { |
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.
I can see how this simplifies things but does it still hold true if we decide to show the inspector in a Modal tomorrow instead of a sidebar panel? Will we need these styles as well in the modal?
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.
Yes if the inspector was in a modal these would still improve the situation.
What these styles do is the following:
- Make sure that when we have a series of PanelBody components the borders does not appear twice (now that I think about it it would probably be a good idea to put this at the component level, I will try to see if there is a style that makes sense there).
- Increase the spacing in fields inside base control e.g: so the fields are not very close to each other and the inspector has more space.
Both actions would also be good in a modal.
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.
Makes sense, both these styles also seem to be something that can be absorbed by the UI components themselves.
2c95fdb
to
6966b34
Compare
5a186ee
to
92b7979
Compare
92b7979
to
abf85da
Compare
This PR makes the block inspector component self contain its styles. Previously part of its styles were in the edit post module, which made the block inspector not display correctly on the widgets screen and on any third party use case.
With this change, we also remove the number of styles needed.
As it is possible to see this change does not touches the widget screen but the inspector there now shows as expected, which means this change benefits any case where the block inspector was shown outside of the edit post.
How has this been tested?
Verified the block inspector looks as before in normal post edit screen.
Verified the block inspector shows as expected on the widgets screen.
Screenshots
Widgets screen before:
Widgets screen after