Skip to content

Support presets for border widths #72015

@cbirdsong

Description

@cbirdsong

Currently, the border control only supports entering widths as arbitrary sizes: https://developer.wordpress.org/themes/global-settings-and-styles/settings/border/

This is not desirable for sites with strict branding requirements, and is much more complicated than selecting from a list of preset sizes.

Developers should be able to register a set of border width presets and disable the ability to input custom border sizes, similar to font sizes or box shadows:

{
	"settings": {
		"border": {
			"width": true,
			"widths": [
				{
					"name": "Small",
					"slug": "sm",
					"size": "0.0625rem"
				},
				{
					"name": "Medium",
					"slug": "md",
					"size": "0.125rem"
				},
				{
					"name": "Large",
					"slug": "lg",
					"size": "0.25rem"
				}
			],
			"customWidth": false
		}
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Design ToolsTools that impact the appearance of blocks both to expand the number of tools and improve the experi[Type] EnhancementA suggestion for improvement.

    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