I have created a script that automatically finds most missing RTL rules in core CSS files. It involves python, a patched css-flip, and some diff processing. The script and instructions on how to use it can be found at https://github.com/hero-m/drupal-rtl-checker.
I have attached the output of the script here, and will try to update it regularly as issues get fixed, so you don't have to run the script yourself.
You can open sub-issues to fix specific parts of the output, and link them to this issue.
Just two notes when fixing the issues:
- Check if the LTR properties already have an RTL equivalent. If so, just add the /* LTR */ comment to the end of the LTR property.
- If the LTR property has four values, do NOT include the -top/-bottom values in the RTL property. Instead only override the -left/-right values in the RTL property. for example, if the LTR property is:
padding: 0 20px 10px 0;
The RTL override should look like this:
padding-right: 0; padding-left: 20px;
Comment | File | Size | Author |
---|---|---|---|
#35 | 2359331-nr-bot.txt | 596 bytes | needs-review-queue-bot |
#29 | 2359331-29.patch | 879 bytes | djsagar |
#28 | 2359331-28.patch | 873 bytes | djsagar |
#19 | quickedit-RTLtoolbar-2359331-19.patch | 863 bytes | simply021 |
#17 | quickedit-RTLtoolbar-2359331-17.patch | 891 bytes | hatcat |
Comments
Comment #1
herom CreditAttribution: herom commentedUpdated the code, removing quite some false-positives.
Comment #2
herom CreditAttribution: herom commentedAnother update, removing more false-positives.
Also, filed the first sub-issue at #2360069: Add missing RTL rules to Seven tabs.css.
Comment #3
herom CreditAttribution: herom commentedComment #4
Gábor HojtsyComment #5
Gábor HojtsyDid you also see #197641: Drag and drop is not RTL aware?
Comment #6
herom CreditAttribution: herom commentedUpdating the automated tool results. 3 RTL issues have gotten in, since last results: #2360069: Add missing RTL rules to Seven tabs.css, #2343715: Fix RTL issues in shortcut module, #2349373: Menu label overlaps with the dropdown trigger on narrow screens on RTL. Yay!
There are also two older RTL issues in the queue waiting for review:
#2329649: Fix node create page RTL CSS and #2343181: RTL issues on front page
Comment #7
Gábor HojtsyAnything left here? Are you still working on this @herom?
Comment #8
Gábor HojtsyIn fact looks like #2329649: Fix node create page RTL CSS was the only one remaining and it is RTBC.
Comment #9
herom CreditAttribution: herom commentedActually, there is still a lot of work to do here. I was originally waiting for #2377685: Fix outdated CSS rules in Views UI to get in before posting the next patch/issue, but then I got too busy with client work to get back to this.
As of now, there are 193 missing RTL rules detected by the automated checker, and the new patch at #2393267: Add missing RTL rules to Views UI CSS decreases that to 157.
Comment #10
Gábor HojtsySorry I don't know how I missed that, its in the child issues but not mentioned in the comments, but that should not have limited me in understanding that there were still child issues.
Comment #11
herom CreditAttribution: herom commented@Gabor, that issue was opened after you marked this one as fixed, so you couldn't have seen it in the child issues.
Anyway, I have opened three more issues (one with a patch):
#2396473: Add missing RTL rules to System CSS
#2396483: Add missing RTL rules to Seven theme CSS
#2396489: Add missing RTL rules to Bartik theme CSS
A few more issues have to be opened, but I will wait for these to go in, before deciding how to group the remaining missing RTL rules.
Comment #12
hatcat CreditAttribution: hatcat commentedI'm at DrupalCon LA First Time Sprint and have located this issue. I am ready to start patching these files. Here goes!
Comment #13
hatcat CreditAttribution: hatcat commented@Gabor and @herom, I would like to work on this issue. Could you run the script and post here, so I can see what is left to work on. Thanks!
Comment #14
herom CreditAttribution: herom commentedSure. Here is the updated results. The missing RTL rules in System module are being worked on in a sub-issue, but feel free to look at the rest.
Comment #15
hatcat CreditAttribution: hatcat commented@herom - I am confused about where/how to configure my test site to display RTL. I have tried to set it up via Config, Regions & Languages - I set the language to Iraq. I also tried adding /admin/config/regional/language/edit/en to the end of my site address as suggested on the child issue comments and I get a page not found error. I thought I might have to set up when I originally configure the site, but I think that might give me a site in a language I can't read. Any help would be appreciated.
Comment #16
Gábor Hojtsy@hatcat: use your favorite language to install Drupal. Does not matter which language. Go edit the language in Regional and language >> Languages and set it to right to left. It does not matter which language you test with, just that its RTL.
Comment #17
hatcat CreditAttribution: hatcat commentedSubmitting my first patch. This addresses the QuickEdit module toolbar. Please let me know if I'm submitting correctly. I have attached screenshots showing the LTR toolbar, the uncorrected RTL toolbar and the corrected RTL toolbar.
Comment #18
hatcat CreditAttribution: hatcat commentedTrying to add the "needs review" status for comment #17
Comment #19
simply021 CreditAttribution: simply021 at Develomon commentedGreat work @hatcat , also regarding #17 adding patch with blank line at the end of file.
And by https://www.drupal.org/node/1887862#format suggesting code reformating
from this
to this
So as other styles in file quickedit.icons.theme.css .
Comment #28
djsagar CreditAttribution: djsagar at OpenSense Labs commentedJust re-rolled the patch for 8.9.x-dev.
Comment #29
djsagar CreditAttribution: djsagar at OpenSense Labs commentedJust re-rolled the patch.
Comment #34
smustgrave CreditAttribution: smustgrave at Mobomo commentedSince this is a META assume it should be under plan then.
Comment #35
needs-review-queue-bot CreditAttribution: needs-review-queue-bot as a volunteer commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.