Skip to content
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

Remove .components-item-group selector in edit-site components #67384

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

im3dabasia
Copy link
Contributor

Fixes: #67369

What?

The .components-item-group selector has been replaced with a custom class (.edit-site-sidebar-navigation-screen__item-group) that is scoped specifically to the sidebar navigation screen.

This change does not affect other components outside of the sidebar navigation screen and will prevent unintended side effects if the ItemGroup component is used elsewhere in the future.

Screenshot

Screenshot 2024-11-28 at 2 38 10 PM

@im3dabasia im3dabasia marked this pull request as ready for review November 28, 2024 10:21
@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 28, 2024
Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @im3dabasia! In case you missed it, we'd love to have you join us in our Slack community.

If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information.

Copy link

github-actions bot commented Nov 28, 2024

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: im3dabasia <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: afercia <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copy link
Contributor

@t-hamano t-hamano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR!

There are no strict rules, but in the Gutenberg project, many components define CSS class names based on the following rules:

{package-name}-{component-name|file-name}

This component is in the edit-site package and the file name is sidebar-navigation-screen-main, so an example of one CSS class name would be edit-site-sidebar-navigation-screen-main.

I don't think we should include the components used inside the component (in this case the ItemGroup component) in the CSS class name.

What do you think about these points?

@t-hamano t-hamano added [Type] Code Quality Issues or PRs that relate to code quality [Package] Edit Site /packages/edit-site labels Nov 28, 2024
@im3dabasia
Copy link
Contributor Author

What do you think about these points?

Yes, I saw how the class names are given in the project. I appreciate your example, and I think the name you suggested is appropriate for our context.

I will make the changes right away.

@im3dabasia
Copy link
Contributor Author

I have made the changes as suggested. Please check now, @t-hamano. Let me know if there are any further changes.

@t-hamano
Copy link
Contributor

Thanks for the update!

Sorry, I missed an important point. The .edit-site-sidebar-navigation-screen__content .components-item selector is applied to more than just the Design screen. We need to apply horizontal negative margins to these screens as well:

Navigation

image

Pages

image

Templates

image

Patterns

For this screen, the edit-site-sidebar-navigation-screen-patterns__group class name is already applied, so we can use it.

image

Can I use a similar approach to add class names to these components? 🙏

@im3dabasia
Copy link
Contributor Author

Can I use a similar approach to add class names to these components?

Yes @t-hamano , I have done as you have suggested please check now.

Navigation Screen
Picture 1

Pages Screen
Picture 2

Templates Screen
Picture 3

Patterns Screen
Picture 4

Thank you for reviewing my work @t-hamano . Please let me know if any changes are needed in the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Package] Edit Site /packages/edit-site [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove usage of .components-item-group CSS selector from edit-site components
2 participants