Skip to:

Opened 5 years ago

Closed 5 years ago

#8097 closed defect (bug) (fixed)

RTL stylesheets must replace with regular ones, not extend them

Reported by: geminorum's profile geminorum Owned by: imath's profile imath
Milestone: 5.0.0 Priority: high
Severity: normal Version:
Component: Core Keywords: has-patch


The old WordPress way of registering RTL styles is to extend default css with RTL diffs. But the RTLCSS npm package generates a full RTL version of styles and must replace with the default. So wp_style_add_data() will not work correctly since it enqueues both styles together.

Attachments (2)

8097.1.diff (10.0 KB) - added by geminorum 5 years ago.
8097.2.diff (5.3 KB) - added by geminorum 5 years ago.
with “replace” data key

Download all attachments as: .zip

Change History (6)

5 years ago

#1 @geminorum
5 years ago

  • Keywords has-patch added

#2 @imath
5 years ago

  • Keywords needs-refresh reporter-feedback added
  • Milestone changed from Awaiting Review to 5.0.0

Hi @geminorum

Thanks a lot for your ticket and for your patch. Instead of defining a $rtl variable to eventually use the rtl version instead of the ltr, I think it can be achieved using 'replace' instead of true for the last argument of wp_style_add_data().

For instance :

wp_style_add_data( 'bp_activity_admin_css', 'rtl', 'replace' );

Could you check if it's the case and if so, update the patch accordingly ?

Last edited 5 years ago by imath (previous) (diff)

5 years ago

with “replace” data key

#3 @geminorum
5 years ago

  • Keywords needs-refresh reporter-feedback removed

Hi @imath

thanks for the tip, the patch updated accordingly.

#4 @imath
5 years ago

  • Owner set to imath
  • Resolution set to fixed
  • Status changed from new to closed

In 12401:

When needed RTL versions of CSS used in Core now replace the LTR ones

Props geminorum

Fixes #8097

Note: See TracTickets for help on using tickets.