-
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
Fix Site editor navigation menu items alignment visual regression. #67321
Conversation
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: +1 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
Flaky tests detected in 0b81255. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12046191537
|
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 fixes the visual regression for me. Thanks for the speedy fix!
And for catching it too @jameskoster
Trunk
This PR
Mobile:
@@ -18,7 +18,7 @@ | |||
.edit-site-sidebar-navigation-screen__content { | |||
padding: 0 $grid-unit-20; | |||
|
|||
.edit-site-sidebar-navigation-screen-details-footer { | |||
.components-item-group { |
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
<ItemGroup> |
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 other ItemGroup
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.
de17a9c
to
0b81255
Compare
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 agree with Aki, we should avoid targeting .components-
classes. But since that was the case prior to the regression it seems fine to either address the issue here, or merge and follow up.
I agree that unrelated enhancements should not be part of a revert for a small fix. Thanks all for your review and feedback. I wil create a separate issue to remove the usage of the |
…67321) Co-authored-by: afercia <[email protected]> Co-authored-by: ramonjd <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: jameskoster <[email protected]>
Follow-up to #66606
Cc @jameskoster @t-hamano
What?
Fizes a visual regression in the alignment of the Site editor Navigation menu items after #66606 where a CSS selector change was applied in a wrong place.
See #66606 (comment)
Why?
Better alignment.
How?
Restore previous selectors. Although using selectors related to components is not ideal, this restores the previous situation. Applies the code review suggestions from #66606 in the right place.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast