Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global Styles: Add block-level textAlign UI #60762

Open
t-hamano opened this issue Apr 16, 2024 · 3 comments
Open

Global Styles: Add block-level textAlign UI #60762

t-hamano opened this issue Apr 16, 2024 · 3 comments
Assignees
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.

Comments

@t-hamano
Copy link
Contributor

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

@t-hamano t-hamano added [Type] Enhancement A suggestion for improvement. Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json labels Apr 16, 2024
@t-hamano t-hamano self-assigned this Apr 16, 2024
@t-hamano
Copy link
Contributor Author

This UI will need to ship to WP6.6. See this comment.

@colorful-tones
Copy link
Member

@t-hamano I happened to notice you’re tackling some text-align stuff and I wonder if you think some of your work might solve #60838 🤔 (perhaps it is even a duplicate issue?)

@t-hamano
Copy link
Contributor Author

#60838 seems to suggest adding Justification controls that already exist in the block toolbar.

I believe this is a separate issue since this issue is intended to add a new text alignment UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Type] Enhancement A suggestion for improvement.
Projects
Status: 🏗️ In Progress
Development

No branches or pull requests

2 participants