-
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
Fix Site editor navigation menu items alignment visual regression. #67321
Merged
afercia
merged 1 commit into
trunk
from
fix/site-editor-navigation-menu-items-alignment
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
An alternative to targeting the inner component's class name, which could change without notice, would be to add a className to the
<ItemGroup />
here:gutenberg/packages/edit-site/src/components/sidebar-navigation-screen-main/index.js
Line 26 in 6e884dc
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 but then it should be done for all the
<ItemGroup>
s in all the navigation sub-panels. Not sure it's in the scope of this PR though a follow-up for a better solution would be welcome.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 recommend avoiding selectors with the
components-
prefix whenever possible, otherwise this style may have unintended side effects if an ItemGroup component is added to the sidebar in the future.This is the only place in all of Gutenberg where the
.components-item-group
selector is used. Admittedly, there are many otherItemGroup
components that don't have CSS class names, but since they don't have their own styling, I don't think they need CSS class names in the first place.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.
@t-hamano we all agree CSS selectors from components should be avoided. However, this PR scope is to just fix a regression by restoring the previous usage where
.components-item-group
was already in use. We should avoid scope creep. Further improvements can be made in a follow-up.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.
Since what I proposed is just a small code quality improvement and it targets the same component, I think it's okay to include it in this PR.
Of course, we can address it in a follow-up, so feel free to merge it as is.