-
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
Fix Blocker Picker autocompleter icon spacing #14772
Conversation
During the creation of block-editor the className on the autocompleter wasn’t updated. This change updates the class to use the `block-editor-` prefix. This causes the CSS to apply again thereby correcting the margin that was missing.
@@ -54,7 +54,7 @@ export function createBlockCompleter( { | |||
} = {} ) { | |||
return { | |||
name: 'blocks', | |||
className: 'editor-autocompleters__block', | |||
className: 'block-editor-autocompleters__block', |
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 think this className shouldn't be updated since it's the editor package. Any reasons for this @aduth and are there other similar use-cases?
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.
This does appear to have been included in the updates from editor-
to block-editor-
in #14420, and in retrospect, I can't see any reason why it should have been (there are no other references outside the editor
package). I think the correct course of action then would be to change the applied styles back from .block-editor-
to .editor-
in src/components/autocompleters/style.scss
.
https://github.com/WordPress/gutenberg/pull/14420/files#diff-ea8f473f0650959558c8075aac355a73
This appears to have been the only file changed in packages/editor/
in #14420.
This reverts commit 28eb706.
Co-Authored-By: Daniel Richards <talldan@users.noreply.github.com>
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.
* Fixes classname to match package and CSS rule During the creation of block-editor the className on the autocompleter wasn’t updated. This change updates the class to use the `block-editor-` prefix. This causes the CSS to apply again thereby correcting the margin that was missing. * Revert "Fixes classname to match package and CSS rule" This reverts commit 28eb706. * Editor: Revert autocompleters classnames to editor prefix Co-Authored-By: Daniel Richards <talldan@users.noreply.github.com>
* Fixes classname to match package and CSS rule During the creation of block-editor the className on the autocompleter wasn’t updated. This change updates the class to use the `block-editor-` prefix. This causes the CSS to apply again thereby correcting the margin that was missing. * Revert "Fixes classname to match package and CSS rule" This reverts commit 28eb706. * Editor: Revert autocompleters classnames to editor prefix Co-Authored-By: Daniel Richards <talldan@users.noreply.github.com>
During the creation of the
block-editor
package theclassName
in the JSX on the autocompleter wasn’t updated. However the CSS rule was updated. This inconsistency meant that a number to CSS rules were no longer being applied.The main result was that the Block autocompeleter lost its right hand margin thereby making the icon too close to the text.
What was fixed?
This PR updates the
className
in the JSX to use theblock-editor-
prefix. This causes the CSS to apply again thereby correcting the margin that was missing.Fixed version - note the space between icon and text has been restored:
Types of changes
Bug fix (non-breaking change which fixes an issue).
Checklist: