[wp-trac] [WordPress Trac] #53090: Admin color schemes don't work in RTL

WordPress Trac noreply at wordpress.org
Thu Apr 29 18:24:32 UTC 2021


#53090: Admin color schemes don't work in RTL
----------------------------+-----------------------
 Reporter:  tomjcafferkey   |       Owner:  (none)
     Type:  defect (bug)    |      Status:  reopened
 Priority:  normal          |   Milestone:  5.7.2
Component:  Administration  |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  css, rtl
----------------------------+-----------------------

Comment (by ryelle):

 The root of the problem here is that Page Optimize hoists the color CSS
 file up above the rest of the CSS, but it's intended to override the other
 CSS. When it's loaded early, the default colors end up overriding the
 selected color scheme. You can see a similar issue with Page Optimize +
 non-RTL sites in [attachment:"Screen Shot 2021-04-29 at 2.11.29 PM.png"]
 The plugin should probably exclude this file from its concatenation.

 > I was also curious if not using wp_style_add_data( 'colors', 'rtl',
 'replace' ) was intentional.

 I'm looking into this as a write, and so the patch I uploaded is wrong 😅

 This comes from r26780/#26316 - when on the profile page in an RTL
 language, click through the color scheme live previews, with
 [attachment:"53090.diff"] it loads the non-RTL stylesheet. This is most
 obvious in the admin menu [attachment:"Screen Shot 2021-04-29 at 2.19.35
 PM.png"]. It uses the URL in `$_wp_admin_css_colors`, so that needs to be
 RTL-aware.

 ------

 For record-keeping, this is the logic behind [attachment:"53090.2.diff"] -
 but we probably shouldn't make that change.

 > However, while this fixes the issue when the plugin is active when using
 an RTL language, it causes the color schemes to not load when the plugin
 is inactive and using an RTL language.

 When it's automatically RTL'd with `add_data`, the style's handle changes
 to `colors-rtl`, and then the URL replacement doesn't happen. I updated
 the patch with a check for `colors-rtl`, so now it will work in both
 cases.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/53090#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list