Site Tagline : Migrate to Text-Align Block Support#75690
Conversation
|
Size Change: +120 B (0%) Total Size: 6.84 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 7f41839. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/22146567719
|
|
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. |
| "attributes": { | ||
| "textAlign": "center" | ||
| } | ||
| "viewportWidth": 350 |
There was a problem hiding this comment.
Text positioning should be maintained according to the new block support.
"example": {
"viewportWidth": 350,
"attributes": {
"style": {
"typography": {
"textAlign": "center"
}
}
}
}| const blockProps = useBlockProps( { | ||
| className: clsx( { | ||
| [ `has-text-align-${ textAlign }` ]: textAlign, | ||
| 'wp-block-site-tagline__placeholder': ! canUserEdit && ! tagline, |
There was a problem hiding this comment.
Why are we removing the wp-block-site-tagline__placeholder class?
|
Thank you for the review. I mistakenly removed the placeholder class, and I will update the PR to include both corrections. |
7f41839 to
94c2f3d
Compare
|
I have included both corrections in the latest commit. |
| 'wp-block-site-tagline__placeholder': ! canUserEdit && ! tagline, | ||
| } ), | ||
| className: | ||
| ! canUserEdit && ! tagline |
There was a problem hiding this comment.
Nit: It can be simpler
const blockProps = useBlockProps( {
className:
! canUserEdit && ! tagline && 'wp-block-site-tagline__placeholder',
} );6cb8d85 to
cdde329
Compare
|
I have simplified the condition as mentioned. |
What?
Part of #60763
Migrates the
Site Taglineblock to use the textAlign block support instead of a customtextAlignattribute. As a consequence it also enables global styles support fortextAlignfor theSite Tagline.Why?
The
Site Taglineblock currently implements its own text alignment logic with a custom align attribute, duplicating code that should be handled by the centralizedSite Taglineblock support. This migration reduces code duplication and consolidates alignment handling across blocks.How?
Replaces the custom logic with the block supports, adds deprecation and fixes transforms.
Testing Instructions
Site Taglineblock and test text alignment (left, center, right)Site Taglineblocks that have alignment set