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

6.7: Writing mode / text orientation is not applied to the Site title block on the front #65910

Closed
2 tasks done
carolinan opened this issue Oct 7, 2024 · 11 comments
Closed
2 tasks done
Assignees
Labels
[Block] Site Title Affects the Site Title Block [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended

Comments

@carolinan
Copy link
Contributor

Description

In WordPress 6.7-beta1-59184, the inline CSS for the typography option for vertical text is not applied on the front, only in the editors.

-The theme (Twenty Twenty-Five) has "writingMode": true, in theme.json > settings > typography.

  • Other blocks like heading work.

If I activate Gutenberg trunk, the option works correctly.
Since Twenty Twenty-Five relies on this feature to work for one of the alternative headers, can we rest assured that this will work in 6.7 without Gutenberg?

Step-by-step reproduction instructions

First, make sure the theme has support for writingMode.
Next, insert a site title block.
In the block settings sidebar, open the Typography panel, activate "Orientation" and select vertical. Save.
View the block on the front.

Screenshots, screen recording, code snippet

No response

Environment info

No response

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

  • Yes
@carolinan carolinan added [Type] Bug An existing feature does not function as intended [Block] Site Title Affects the Site Title Block labels Oct 7, 2024
@ndiego ndiego moved this to 📥 Todo in WordPress 6.7 Editor Tasks Oct 7, 2024
@ndiego
Copy link
Member

ndiego commented Oct 7, 2024

I can confirm.

Editor Front end
Image Image

@getdave
Copy link
Contributor

getdave commented Oct 7, 2024

Thanks for flagging this.

can we rest assured that this will work in 6.7 without Gutenberg?

I don't think we should no. We need to track down the missing PR and make sure it's included in 6.7.

I see references to writingMode in 2023 so I'm confused as to how this isn't already in Core.

I was away for the 6.6 cycle so perhaps @ellatrix might know (also cc @MaggieCabrera @mikachan).

@ndiego
Copy link
Member

ndiego commented Oct 7, 2024

@getdave I just confirmed this issue happens with the Site Tagline block as well. Perhaps it's due to the fact that both are dynamic blocks?

@t-hamano
Copy link
Contributor

t-hamano commented Oct 7, 2024

It looks like the style engine doesn't support wirtingMode in WP 6.7 Beta1.

The following code exists in Gutenberg:

'writingMode' => array(
'property_keys' => array(
'default' => 'writing-mode',
),
'path' => array( 'typography', 'writingMode' ),
),

However, this code doesn't exist in WP 6.7 Beta1:

https://github.com/WordPress/WordPress/blob/42db3985961d284426e90c89258ffc78dc4e9eb8/wp-includes/style-engine/class-wp-style-engine.php#L307

If you add the Gutenberg-only code to the core as well, it works correctly on the frontend.

Maybe a PHP backport to core was missed during one of the major releases.

@ndiego
Copy link
Member

ndiego commented Oct 7, 2024

Maybe a PHP backport to core was missed during one of the major releases.

Ah perhaps. cc @kevin940726 @andrewserong

@ndiego ndiego added the [Priority] High Used to indicate top priority items that need quick attention label Oct 7, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Oct 7, 2024

My understanding is that any changes to the style engine need to be manually backported to the core.

However, the following PR doesn't seem to include any changes to the style engine:

@andrewserong
Copy link
Contributor

My understanding is that any changes to the style engine need to be manually backported to the core.
However, the following PR doesn't seem to include any changes to the style engine:

That's my understanding, too. Looks like WordPress/wordpress-develop#5210 was intended to backport #50822, however missed the changes to class-wp-style-engine.php. The writing mode support was only added to the Site Title block fairly recently (#62727), so I imagine we just haven't been in a situation where the long-standing bug was made visible in core.

I'm happy to put up a core PR to add in the missing lines to the style engine, if no-one beats me to it!

@andrewserong andrewserong self-assigned this Oct 8, 2024
@andrewserong andrewserong moved this from 📥 Todo to 🏗️ In Progress in WordPress 6.7 Editor Tasks Oct 8, 2024
@t-hamano
Copy link
Contributor

t-hamano commented Oct 8, 2024

Note: In WordPress 6.6, writingMode is available for the following four blocks:

  • Paragraph
  • Heading
  • Footnotes
  • Post Navigation Link (Next Post, Previous Post)

The Paragraph and Heading blocks have inline styles embedded in HTML, so they displayed correctly on the frontend even if the style engine did not support writingMode.

On the other hand, the Footnotes and Post Navigation Link blocks are dynamic blocks, so the style engine must support them to render them correctly on the frontend.

Perhaps this issue was overlooked because so few people use writingMode in dynamic blocks.

@andrewserong
Copy link
Contributor

andrewserong commented Oct 8, 2024

Thanks for looking that up, Aki!

Perhaps this issue was overlooked because so few people use writingMode in dynamic blocks.

Yes, that sounds most likely to me, it can be really easy to miss testing these things in core, especially when we're so regularly working on the features in Gutenberg.

I've opened up a core PR to resolve this over in WordPress/wordpress-develop#7534, and here's the trac ticket for it, too: https://core.trac.wordpress.org/ticket/62189

@andrewserong andrewserong moved this from 🏗️ In Progress to 🔎 Needs Review in WordPress 6.7 Editor Tasks Oct 8, 2024
@andrewserong
Copy link
Contributor

The core PR (WordPress/wordpress-develop#7534) has been committed, so the fix will be in WP 6.7 Beta 3. Thanks for the troubleshooting and reviews, everyone!

@github-project-automation github-project-automation bot moved this from 🔎 Needs Review to ✅ Done in WordPress 6.7 Editor Tasks Oct 9, 2024
@getdave
Copy link
Contributor

getdave commented Oct 9, 2024

Thank you for wrangling this folks 👏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Site Title Affects the Site Title Block [Priority] High Used to indicate top priority items that need quick attention [Type] Bug An existing feature does not function as intended
Projects
Status: Done
Development

No branches or pull requests

5 participants