-
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
Adds default wp-block-list class to list block #36676
Conversation
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @luminuu! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
There's a much simpler way of doing this, if I recall correctly. Just remove this line in the List By default, the block editor generates a class name from the name in the Also, it's likely that several tests will need to be updated to reflect the altered markup. |
This was actually my first try but it didn't seem to have any effect. But I'm happy to learn if I just missed something else. I also didn't expect that many tests to fail but they just do because of the altered markup with the class, as it seems. |
I've checked again on the code and it looks like I actually missed something while testing earlier. I reverted my previous change and removed the className property in block.json as suggested by @ZebulanStanphill. I also updated a few files related to tests to make them pass with the new markup, still working on that. |
See also #12420 (comment). |
Description
This pull request adds a default class
wp-block-list
to the list block on the frontend. The issue for this is #12420. The change enhances the developer experience as it enables developers to use a specific selector for the list block, without having to rely on any parent elements or using too many :not() statements.How has this been tested?
Local environment: MAMP with WP 5.8.2 installed on macOS Catalina
Tested by adding a new list block to a post. Also changed various settings as well as adding additional CSS classes at the advanced tab.
Screenshots
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
*.native.js
files for terms that need renaming or removal).