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

RTL fix for inlined block-styles #41762

Merged
merged 5 commits into from
Sep 6, 2022
Merged

RTL fix for inlined block-styles #41762

merged 5 commits into from
Sep 6, 2022

Conversation

aristath
Copy link
Member

What?

Fixes #41649

Why?

When replacing block styles in Gutenberg, we don't account for RTL styles.

How?

Adds an extra condition to change the path for inline styles to their RTL counterpart.

Testing Instructions

Switch to an RTL language and ensure that the RTL styles get loaded.
To make testing easier, you can also add var_dump( $style_path ); below the line that changed to see more clearly that the RTL styles are the ones that get loaded.

@aristath aristath added the [Type] Bug An existing feature does not function as intended label Jun 16, 2022
@aristath aristath requested a review from spacedmonkey as a code owner June 16, 2022 08:21
lib/blocks.php Outdated Show resolved Hide resolved
Copy link
Contributor

@carolinan carolinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a code review.

With the PR applied, on RTL, using Twenty Twenty-Two.
Navigation block:
Blocks/navigation/style-rtl.css is loading.
The margin on the submenu button is correctly moved to the right of the button.

  • During testing I noticed that this margin was incorrect in WordPress 6.0 without Gutenberg installed. Perhaps this can be backported to a minor release.

Query pagination block:
The arrows are pointing in the correct direction. The spacing is also correct.
This is an improvement over Gutenberg 13.4.0.

Comment pagination block:
The arrows are pointing in the correct direction. The spacing is also correct.
This is an improvement over Gutenberg 13.4.0.

I think it would be good if an RTL user could test and confirm, since there are probably more areas to test than the 3 above.

@carolinan carolinan added the Internationalization (i18n) Issues or PRs related to internationalization efforts label Jun 20, 2022
@aristath
Copy link
Member Author

Updated the PR and rebased, this is now ready for another review 👍

farhadsakhaei added a commit to farhadsakhaei/wordpress-develop that referenced this pull request Aug 16, 2022
There is a problem on all RTL sites using block themes and block CSS files
This fixes loading all RTL CSS files and also add suffix to the styles object

This fixes:
https://wordpress.org/support/topic/rtl-problem-bug/
WordPress/gutenberg#41649
WordPress/gutenberg#41762

CC to locale managers:
@naokomc
@tobifjellner
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change looks good to me 👍

@jorgefilipecosta
Copy link
Member

Does this change need backporting as it seems we have the same problem in core now https://core.trac.wordpress.org/ticket/56325?

@scruffian
Copy link
Contributor

I rebased this.

Copy link
Contributor

@scruffian scruffian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aristath aristath merged commit 1cf52f0 into trunk Sep 6, 2022
@aristath aristath deleted the fix/41649 branch September 6, 2022 06:09
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 6, 2022
@aristath
Copy link
Member Author

aristath commented Sep 6, 2022

Thank you @jorgefilipecosta and @scruffian!

Does this change need backporting as it seems we have the same problem in core now https://core.trac.wordpress.org/ticket/56325?

Yes, it should be backported 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internationalization (i18n) Issues or PRs related to internationalization efforts [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When Gutenberg is active, RTL styles are not loading correctly on the front.
4 participants