Skip to content

Bring "section style" JSON partials to feature parity with WP_Block_Styles_Registry::register #63263

@bacoords

Description

@bacoords

What problem does this address?

There are a few arguments in the WP_Block_Styles_Registry that aren't present in the new "Section Styles" feature. It would be great to bring these arguments all to parity so that "section styles" could become a 1:1 replacement for PHP/server-side registration of block styles.

What is your proposed solution?

In section styles JSON files, consider adding support for

  • style_handle - the ability to reference a CSS file registered by the theme
  • is_default - the ability to modify/set the default styles for a block

The second one in particular would be particularly handy for making themes more composable and trimming down the site of the theme.json file. All block styles could be defined as separate JSON files, blocks could share default styles if necessary, etc. (This has been replaced with #63307)

Related: https://developer.wordpress.org/reference/classes/wp_block_styles_registry/register/
Related: https://make.wordpress.org/core/2024/06/24/section-styles/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions