Global Styles: Add text alignment support to elements#73854
Conversation
|
Size Change: -9 B (0%) Total Size: 2.58 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 054730d. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20130756938
|
t-hamano
left a comment
There was a problem hiding this comment.
Everything is working fine, I think we can ship this PR once we update the unit tests.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
What?
Related https://github.com/WordPress/gutenberg/pull/61717/files#r1603273968
Enables the text alignment control for elements (like text, headings, buttons, etc.) in the Global Styles UI.
Why?
Even when
typography.textAlignis set totruein theme.json, the text alignment control was not showing up in the Global Styles UI when editing elements. This was because the code explicitly disabled textAlign for all elements.How?
packages/block-editor/src/components/global-styles/hooks.jsthat was forcingtextAlign: falsefor all elementstextAlignto theROOT_BLOCK_SUPPORTSarray inpackages/blocks/src/store/private-selectors.jsso it's recognized as a valid element styleTesting Instructions