[wp-trac] [WordPress Trac] #57903: Non-core blocks are not properly loading RTL stylesheets
WordPress Trac
noreply at wordpress.org
Fri Mar 10 15:20:02 UTC 2023
#57903: Non-core blocks are not properly loading RTL stylesheets
--------------------------+-----------------------------
Reporter: david.binda | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Editor | Version: 6.1.1
Severity: normal | Keywords:
Focuses: css, rtl |
--------------------------+-----------------------------
This is a follow-up to #56325 where an issue for core-blocks has been
reported. There's also #56797 which adds PHPUnit tests for RTL stylesheets
loading, however the current logic introduced in r54330 only works in a
situation when the `SCRIPT_DEBUG` is defined and set to `true` (which is
the case during the PHPUnit tests being run).
When the `SCRIPT_DEBUG` is set to `false`, the `-rtl` styles for non-core
blocks are not being loaded.
To reproduce the issue, I used [https://github.com/WordPress/gutenberg-
examples/tree/trunk/blocks-non-jsx/02-stylesheets the blocks-non-
jsx/02-stylesheets block of the gutenberg examples repository] and added a
modified style-rtl.css file to the block.
On a site in one of the RTL languages, I added the block to a post and it
can be seen on a frontend that the style-rtl.css is only loaded when the
`SCRIPT_DEBUG` is set to `true`.
The bug seems to be due to the fact that core blocks'
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/blocks.php?rev=55447#L221 styles are being loaded with `.min`
suffix, while non-core ones are never using the minified files], but the
[https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/blocks.php?rev=55447#L263 suffix is always being taken into
consideration when the -rtl file lookup is performed].
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57903>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list