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;
    
Support from Acquia helps fund testing for Drupal Acquia logo

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

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

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.

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

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.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.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.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.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.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.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

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

djsagar’s picture

Just re-rolled the patch for 8.9.x-dev.

djsagar’s picture

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

smustgrave’s picture

Category: Bug report » Plan

Since this is a META assume it should be under plan then.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
FileSize
596 bytes

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

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.