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 selector from list block which prohibits border changes for nested lists #66930

Conversation

Anuj-Rathore24
Copy link

@Anuj-Rathore24 Anuj-Rathore24 commented Nov 12, 2024

What?

This PR resolves issue - #66885

It removes a selector in list block, for not including nested lists block for applying border styles.

  • Steps to reproduce bug can be found in the issue itself.

How and why?

Because of this selector the changes in border styles are not being applied in the main list block itself. As far as I have tested there is no way to add nested list in WordPress which will emulate this behaviour.

Screenshots or screencast

Screenshot 2024-11-12 at 6 43 42 PM

Copy link

github-actions bot commented Nov 12, 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: Anuj-Rathore24 <[email protected]>
Co-authored-by: aaronrobertshaw <[email protected]>

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

Copy link

👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @Anuj-Rathore24! 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.

@github-actions github-actions bot added the First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository label Nov 12, 2024
@Anuj-Rathore24 Anuj-Rathore24 changed the title Feat: Remove selector for not including nested lists. Remove selector from list block which prohibits border changes for nested lists Nov 12, 2024
@akasunil akasunil added [Type] Bug An existing feature does not function as intended [Block] List Affects the List Block labels Nov 12, 2024
Copy link
Contributor

@aaronrobertshaw aaronrobertshaw 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 putting up this PR @Anuj-Rathore24 👍

When border support for the List block was added, it was determined that allowing global styles for List blocks to apply to nested blocks was undesirable.

Simply removing this selector will break that behaviour. It would also be a breaking change for themes and users that have already adopted global border styles on list blocks.

Here's a quick look at the results of adding a global border style for the List block after removing the custom selector as proposed in this PR:

Screenshot 2024-11-14 at 11 47 30 am

After following the issue's replication steps, you can see that there are styles for the custom block style variation on the page however its selector is incorrect.

:root :where(.wp-block-list.is-style-my-list-border--2.is-style-my-list-border--2 .wp-block-list:not(.wp-block-list .wp-block-list))

Screenshot 2024-11-14 at 11 51 10 am

I'm hopeful the fix here will be small in terms of code changes but the section styles (block style variations) feature is a tricky and complex beast.

I'd like to propose closing this PR as the approach would break more use cases than it fixes. I can dig deeper into a fix for the block style varation selectors and if you have the bandwidth, I'd love your help testing the solution when it is ready.

How's that sound to you?

@Anuj-Rathore24
Copy link
Author

Hey @aaronrobertshaw,
Thank You for this review, I believe you are right. And yes, I would love to contribute in any way possible🙇.

@aaronrobertshaw
Copy link
Contributor

Sounds like a plan, thanks @Anuj-Rathore24 🙇

I have a few loose ideas that I'll explore tomorrow. For now, I'll close this as agreed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block First-time Contributor Pull request opened by a first-time contributor to Gutenberg repository [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants