-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
Is your feature request related to a problem? Please describe.
The subject of adding classes to default blocks was discussed at #6639, and I know you can filter the List block to add a new class, but the wp-block-list class should be present by default.
Without a specific class, any style applied to the generic <ul> will inadvertently affect elements from third-party plugins or custom HTML added elsewhere, and we can't know beforehand if they will be affected.
One practical example happens when you try, for instance, to style the List block in a theme to add new bullets and you are also using the Elementor plugin.
Without a class, the generic .ul style will affect <li> elements used by Elementor in their control handles β unless you explicitly filter the class or resort to a convoluted solution as ul:not(.elementor-editor-element-settings):not(.wp-block-gallery):not(.wp-block-categories):not(.wp-block-latest-posts)... and so on.
This will surely happen with lots of other plugins that use the <ul> tag for tasks like this.
Image 1: Custom style added to <ul> tag.
Image 2: Custom style affecting a third-party plugin.
Describe the solution you'd like
Just add the wp-block-list class to the <ul> tag by default, in the List block.
Describe alternatives you've considered
- Filter the List block to add a new class
- Add multiple
:not()to the generic.ulstyle to target only the List block.
Tested with 5.0-RC1-43946

