PRC's override/extension of the WordPress core/list block.
Block Namespace
prc-block/core-list
What PRC Customizes
- Enables
blockGapspacing support (not enabled by default in core) - Registers an "Unstyled List" block style that removes list bullets/numbers
- Applies a
--block-gapCSS custom property to control spacing between list items - Adds the
wp-block-listclass to the rendered list element on the frontend
Supports Modifications
| Support | Change |
|---|---|
spacing.blockGap | Enabled (true) — allows gap control between list items |
The blockGap support is added both in PHP (add_attributes filter on block_type_metadata) and in JS (blocks.registerBlockType filter).
Additional Attributes
None beyond core. The blockGap support is added via the supports API, not as a custom attribute.
Available Styles
| Style Name | Label | Description |
|---|---|---|
list-style-type-none | Unstyled List | Removes bullets and ::before pseudo-element content |
Registered in index.js via registerBlockStyle.
Style Overrides
File: style.scss
.is-style-list-style-type-none— setslist-style-type: noneand removesli::beforecontent.wp-block-list li:first-child— removesmargin-block-start.wp-block-list li:not(:first-child)— usesvar(--block-gap)formargin-block-startspacing.wp-block-list li a—text-decoration: underlineon list item links
Editor Enhancements
File: index.js
- Adds a higher-order component (
editor.BlockListBlockfilter) that injects--block-gapas a CSS custom property on the block wrapper in the editor - Uses
getBlockGapSupportValuefrom@prc/functionsto compute the gap value
Frontend Interactivity
None. No view.js file.
PHP Rendering
File: class-core-list.php
add_attributes(block_type_metadatafilter) — enablesspacing.blockGapsupport on the core/list block metadatarender(render_blockfilter) — processescore/list-itemblocks to:- Add the
wp-block-listclass to the list element (ulorol) - Set a
--block-gapCSS custom property from the block's gap attribute
- Add the
Note: The render filter targets core/list-item (not core/list) to apply the gap styling.
Block Markup Example
<ul class="wp-block-list" style="--block-gap: 1em;">
<li>Item one</li>
<li>Item two</li>
<li>Item three</li>
</ul>
With the unstyled style:
<ul class="wp-block-list is-style-list-style-type-none" style="--block-gap: 0.5em;">
<li>Item one</li>
<li>Item two</li>
</ul>
Variations
None.