-
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
Remove selector from list block which prohibits border changes for nested lists #66930
Remove selector from list block which prohibits border changes for nested lists #66930
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. |
👋 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. |
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.
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:
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))
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?
Hey @aaronrobertshaw, |
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. |
What?
This PR resolves issue - #66885
It removes a selector in list block, for not including nested lists block for applying border styles.
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