Skip to content

Global Styles: Add block-level textAlign UI #60762

@t-hamano

Description

@t-hamano

What problem does this address?

#59531 adds textAlign as block support. This allows developers to opt-in a dropdown for textAlign on the block toolbar via code like the following:

{
	"$schema": "https://schemas.wp.org/trunk/block.json",
	"apiVersion": 3,
	"name": "core/test",
	"title": "Test",
	"supports": {
		"typography": {
			"textAlign": true
	}
}

Additionally, you can apply default styles to each block via theme.json.

{
	"version": 2,
	"styles": {
		"blocks": {
			"core/media-text": {
				"typography": {
					"textAlign": "center"
				}
			}
		}
	}
}

However, there is no way to override the default style via the Global Styles UI.

What is your proposed solution?

Add block-level global styles UI. One design idea is as follows.

global-styles-text-align

Metadata

Metadata

Assignees

Labels

Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] In ProgressTracking issues with work in progress[Type] EnhancementA suggestion for improvement.

Type

No type
No fields configured for issues without a type.

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions