Skip to content

Global Styles: Add support for default styles #27796

@scruffian

Description

@scruffian

From #27579:

It feels like having a way to set the default padding in the block's supports field instead would make it more convenient for customization purposes. In addition to true it could support an object with default values or anything that the theme.json is using.

As noted on that PR, setting default styles in the way the handbook recommends results in validation errors in the block.

As can be seen in #27582, if we set these values in CSS rather than in the JSON then when the user resets the setting, the CSS takes control, which is confusing for the user.

I agree with @gziolo that we should be able to set this in the block.json somehow.

cc @nosolosw @jorgefilipecosta

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Feature] Site EditorRelated to the overarching Site Editor (formerly "full site editing")[Feature] ThemesQuestions or issues with incorporating or styling blocks in a theme.[Type] EnhancementA suggestion for improvement.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions