[wp-trac] [WordPress Trac] #53090: Admin color schemes don't work in RTL
WordPress Trac
noreply at wordpress.org
Mon Apr 26 14:10:44 UTC 2021
#53090: Admin color schemes don't work in RTL
--------------------------------------+-----------------------------
Reporter: tomjcafferkey | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Keywords:
Focuses: css, rtl, administration |
--------------------------------------+-----------------------------
**Steps to replicate**
* Install [Page Optimize](https://wordpress.org/plugins/page-optimize/)
plugin
* Change your admin color scheme in `/wp-admin/profile.php` to a non-
default scheme
* Go to `/wp-admin/options-general.php` and update your Site Language to
an RTL language
**What I expected to happen**
My admin color scheme would be the one I updated it to.
**What actually happened**
Admin color scheme switched back to the default color scheme.
**Additional information**
We found out this is because there needs to be [extra data
set](https://developer.wordpress.org/reference/functions/wp_style_add_data/)
for RTL when enqueuing the stylesheet:
`wp_style_add_data( 'colors', 'rtl', 'replace' )` fixes this when the site
language is set to RTL
Additional RTL support documentation that recommends `wp_style_add_data`
for RTL found [here](https://codex.wordpress.org/Right-to-
Left_Language_Support).
This will also help maintain consistency as `admin-menu` stylesheet does
include this additional data for RTL support when the Site Language is set
to an RTL language.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/53090>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list