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

Gutenberg tweaks: Remove suffix from RTL styles #638

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

ryelle
Copy link
Contributor

@ryelle ryelle commented Jul 10, 2024

CSS registered from block.json are incorrectly configured with a suffix for RTL sites, but the files don't use a suffix. This prevents the files from being replaced correctly, causing visual issues on RTL sites.

The "simple" fix here is to just wipe out the suffix on all wporg-added styles. Checking for the rtl extra data should also prevent replacing anything that isn't using the block.json registration. We don't use .min or separate minified files anywhere (IIRC), so this shouldn't have any negative impacts.

See https://core.trac.wordpress.org/ticket/61625.

Before After
Query filters Screenshot 2024-07-10 at 5 03 45 PM Screenshot 2024-07-10 at 5 02 27 PM
Local nav Screen Shot 2024-07-10 at 17 04 08 Screen Shot 2024-07-10 at 17 04 43

To test

This is easiest to test on a sandbox, so that you can view a real RTL site. When applied, this should fix a lot of the issues flagged on WordPress/Learn#2483.

@ryelle ryelle requested a review from adamwoodnz July 10, 2024 21:08
@ryelle ryelle self-assigned this Jul 10, 2024
@ryelle ryelle added the i18n label Jul 10, 2024
Copy link
Contributor

@adamwoodnz adamwoodnz left a comment

Choose a reason for hiding this comment

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

Tested in sandbox and query filters and local nav LGTM, great sleuthing.

@ryelle ryelle merged commit 594a577 into trunk Jul 11, 2024
2 checks passed
@ryelle ryelle deleted the fix/rtl-css-suffix branch July 11, 2024 16:59
@adamwoodnz adamwoodnz restored the fix/rtl-css-suffix branch July 22, 2024 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2 participants