Skip to content

Allow plugins to include a theme.json file in the same way themes do #41707

@Aljullu

Description

@Aljullu

Description

Currently, if a plugin wants to set default styles for its blocks, it can either write the styles in CSS or write them in the block default attributes.

None of these approaches allow themes to easily override the styles of the plugin using theme.json.

A solution would be to allow plugins to include a theme.json file in the same way themes are already doing it. Styles specified in the theme.json of a plugin, would have lower priority than the styles from the theme's theme.json and user styles.

This way, plugins can specify the default styles of their blocks in their theme.json and themes can override the styles from their theme.json.

Step-by-step reproduction instructions

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] ExtensibilityThe ability to extend blocks or the editing experience[Type] TaskIssues or PRs that have been broken down into an individual action to take

    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