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:

  1. Check if the LTR properties already have an RTL equivalent. If so, just add the /* LTR */ comment to the end of the LTR property.
  2. 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;
    
Files: 

Comments

herom’s picture

FileSize
53.01 KB

Updated the code, removing quite some false-positives.

herom’s picture

Issue summary: View changes
FileSize
45.26 KB

Another update, removing more false-positives.

Also, filed the first sub-issue at #2360069: Add missing RTL rules to Seven tabs.css.

herom’s picture

Issue tags: +D8MI
Gábor Hojtsy’s picture

Issue tags: +language-base, +sprint
Gábor Hojtsy’s picture

herom’s picture

FileSize
41.54 KB

Updating 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

Gábor Hojtsy’s picture

Anything left here? Are you still working on this @herom?

Gábor Hojtsy’s picture

Status: Active » Fixed
Issue tags: -sprint

In fact looks like #2329649: Fix node create page RTL CSS was the only one remaining and it is RTBC.

herom’s picture

Status: Fixed » Active
FileSize
41.92 KB

Actually, 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.

Gábor Hojtsy’s picture

Sorry 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.

herom’s picture

@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.

hatcat’s picture

I'm at DrupalCon LA First Time Sprint and have located this issue. I am ready to start patching these files. Here goes!

hatcat’s picture

@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!

herom’s picture

FileSize
27.39 KB

Sure. 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.

hatcat’s picture

@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.

Gábor Hojtsy’s picture

@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.

hatcat’s picture

FileSize
104.34 KB
213.04 KB
78.71 KB
891 bytes
PASSED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,814 pass(es). View

Submitting 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.

hatcat’s picture

Status: Active » Needs review

Trying to add the "needs review" status for comment #17

simply021’s picture

FileSize
863 bytes
PASSED: [[SimpleTest]]: [PHP 5.5 MySQL] 113,508 pass(es). View

Great 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

.quickedit .icon:before {
  background-attachment: scroll;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
  content: '';
  display: block;
  height: 100%;
  left: 0; /* LTR */
  position: absolute;
  top: 0;
  width: 100%;
}

to this

.quickedit .icon:before {
  position: absolute;
  top: 0;
  left: 0; /* LTR */
  display: block;
  width: 100%;
  height: 100%;
  background-attachment: scroll;
  background-color: transparent;
  background-position: center center;
  background-repeat: no-repeat;
  content: '';
}

So as other styles in file quickedit.icons.theme.css .

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.