-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Editor: Move editor-sidebar CSS reset closer to its target #71096
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
Conversation
Size Change: -136 B (-0.01%) Total Size: 1.91 MB
ℹ️ View Unchanged
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
@@ -14,3 +14,7 @@ | |||
.editor-post-summary .components-v-stack:empty { | |||
display: none; | |||
} | |||
|
|||
.editor-sidebar { |
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.
Feels like we should be doing the same for all the other editor-*
classnames that are now in the "edit-post" stylesheet no?
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.
Absolutely. I wanted to keep the PR as small as possible to drive the point. I'll move the others.
.editor-sidebar { | ||
width: $sidebar-width; | ||
|
||
> .components-panel { | ||
border-left: 0; | ||
border-right: 0; | ||
margin-bottom: -1px; | ||
margin-top: -1px; | ||
|
||
> .components-panel__header { | ||
background: $gray-100; | ||
} | ||
} | ||
|
||
.block-editor-block-inspector__card { | ||
margin: 0; | ||
} | ||
} |
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 checked these styles one by one. None of them are needed:
width: $sidebar-width;
sets the same width 280px.border-left: 0; border-right: 0;
are not needed because.components-panel
hasborder: none
now.margin-bottom: -1px; margin-top: -1px;
are most likely a trick to collapse the double borders. But there is no border now because of the aforementionedborder: none
.background: $gray-100;
This one does change the background from the original#fff
, to#f0f0f0
, which I found a source of inconsistency.block-editor-block-inspector__card
. There is no such element anymore.
@youknowriad I moved all the styles to their rightful owners. I tried to give the same treatment to |
Thanks for finding the root cause here :) |
What?
The editor-sidebar children (such as
editor-post-panel__row-label
) needbox-sizing: inherit (border-box)
to look visually aligned. In most environments they get this CSS from the CSS reset of theedit-post
package which is often used to render the editor, and all seems fine. But when the editor is rendered directly from@wordpress/editor
, i.e withoutedit-post
package, this reset is missing, and the sidebar items look misaligned as pictured.Why?
This moves the CSS reset to where it actually applies. Removing the need for the assumption that the editor will always run inside the
@wordpress/edit-post
package.How?
But moving the reset from
edit-post
to the editor itself.Testing Instructions
Status
, try to findeditor-post-panel__row-label
.box-sizing: inherit;
.wp-content/plugins/gutenberg/build/editor/style.css?ver=21.3.0
.trunk
,gutenberg/build/edit-post/style.css?ver=21.3.0
.Testing Instructions for Keyboard
Unrelated
Screenshots or screencast
N/A