Skip to content

Consider adding form elements to the theme.json elements block #34198

@MaggieCabrera

Description

@MaggieCabrera

What problem does this address?

A theme will want to have a specific design for its form elements that is consistent across blocks (be them core blocks or third-party). Ideally, if the user wants to alter this design, their changes should expand through all affected blocks from Global Styles, not just one by one (if I want my buttons to be red, I want ALL buttons on the site to be red, not just the button block).

Right now some of the blocks that have form elements don't let you style them or they do so very limitedly. Examples of these are the Search Block, the File Block and the Post comments form Block. The only way for a theme to make them consistent with each other is via CSS.

What is your proposed solution?

We could have buttons, inputs, textareas, labels, selects... be styled within styles.elements on theme.json and have the blocks using them use these styles as presets and in the future surface this in the Global Styles sidebar for the user to change too.

/cc @oandregal @mtias @youknowriad

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[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