-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Fix block toolbar icon CSS when using show icon label preference #73674
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
The CSS for the block toolbar icon was refactored to remove it from the block switcher. This refactor caused a minor regression in the styles for the show icon label preference. The CSS should have been scoped to the block toolbar, but was instead scoped to any instance of the block icon. This fix applies the correct scope.
|
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: 0 B Total Size: 2.58 MB ℹ️ View Unchanged
|
tyxla
left a comment
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.
Thanks for fixing it 🚀
| width: 0 !important; | ||
| height: 0 !important; | ||
| min-width: 0 !important; |
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 know this is prior art, so it's not a blocker, but: any alternatives to using !important here?
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 specificity is high enough without the ! important that these styles apply, but this is the rare occasion where I'd argue for !important. These rules are what is enforcing the Show block labels option. We'd be more likely to have a regression by removing the !important rules. Regressions to this are common, as it's not a feature many devs use. So, in general, I love to remove !important rules, but I think we should leave these.
|
Thanks for fixing this Jerry! |
What?
Closes issue reported in comment by @tellthemachines
The block switcher was refactored to not handle the default block icon of the toolbar in #72935. This refactor caused a minor regression in the styles for the show icon label preference. The CSS should have been scoped to the block toolbar, but was instead scoped to any instance of the block icon. This fix applies the correct scope.
Why?
Fix the layout of the slash inserter and global styles blocks when using the show icon labels preference
How?
Scope the CSS to the block toolbar instead of all block icons (as it was before).
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Style Block Panel
Slash Inserter