-
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
DocumentTools: Use standard ToolbarButton for inserter #68332
Conversation
min-width: $button-size-compact; | ||
width: $button-size-compact; | ||
height: $button-size-compact; | ||
padding: 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.
The padding doesn't seem to be necessary?
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.
Not needed, yes, the button is unchanged as the styles currently come from here:
gutenberg/packages/editor/src/components/document-tools/style.scss
Lines 39 to 48 in dd77795
// The Toolbar component adds different styles to buttons, so we reset them | |
// here to the original button styles | |
.editor-document-tools__left > .components-button.has-icon, | |
.editor-document-tools__left > .components-dropdown > .components-button.has-icon { | |
// @todo override toolbar group inherited paddings from components/block-tools/style.scss. | |
// This is best fixed by making the mover control area a proper single toolbar group. | |
// It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon. | |
height: $button-size-compact; | |
min-width: $button-size-compact; | |
padding: 4px; |
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. |
Size Change: -33 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in dd77795. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12508186171
|
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, thanks for the cleanup 👍
There are still some overrides above in the same stylesheet, but removing them does cause unwanted changes.
min-width: $button-size-compact; | ||
width: $button-size-compact; | ||
height: $button-size-compact; | ||
padding: 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.
Not needed, yes, the button is unchanged as the styles currently come from here:
gutenberg/packages/editor/src/components/document-tools/style.scss
Lines 39 to 48 in dd77795
// The Toolbar component adds different styles to buttons, so we reset them | |
// here to the original button styles | |
.editor-document-tools__left > .components-button.has-icon, | |
.editor-document-tools__left > .components-dropdown > .components-button.has-icon { | |
// @todo override toolbar group inherited paddings from components/block-tools/style.scss. | |
// This is best fixed by making the mover control area a proper single toolbar group. | |
// It needs specificity due to style inherited from .components-accessible-toolbar .components-button.has-icon.has-icon. | |
height: $button-size-compact; | |
min-width: $button-size-compact; | |
padding: 4px; |
In preparation for #68328
What?
Use a standard
ToolbarButton
for the inserter button inDocumentTools
.Why?
To reduce unnecessary style overrides (ToolbarButton uses the
"compact"
Button size by default). This will also prevent a size deprecation warning when we start logging them in #68328.Testing Instructions
In the block editor, check the main inserter button in the top left and see that there are no visual changes.
Note that there are multiple states to check:
Screenshots or screencast
This is the inserter button in DocumentTools: