Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When setting a custom path to a style sheet (say print.css) and in the same path exist also an rtl style sheet (say print-rtl.css) the last should be also called when the site is viewed in an rtl language.
Furthermore I believe these style sheets should be looked for automatically (like the template files) instead of being specified manually.
Comments
Comment #1
jcnventura CreditAttribution: jcnventura commentedIf you're specifying your own custom stylesheet, then of course they have to be specified manually. Further, since you're specifying them, you can make them RTL yourself.
Comment #2
tsi CreditAttribution: tsi commentedWe build a lot of sites that are bi-directional, that means that they are multi-lingual and go ltr when user choose an ltr language and switch to rtl when the user chooses an rtl language.
The default drupal behavior (with drupal_add_css) is :
This way we don't have to choose between ltr and rtl - we can have them both.
Comment #3
jcnventura CreditAttribution: jcnventura commentedYes, and as I said, if you don't specify your own CSS file, that drupal_add_css() call is made.. My question is: have you specified your own CSS file?
Comment #4
tsi CreditAttribution: tsi commentedYes, and then this custom CSS file is loaded, witch is fine for uni-directional site, but it's not enough for a multilingual, bi-directional site.
Comment #5
jcnventura CreditAttribution: jcnventura commentedIn a previous version, the stylesheet could be located anywhere (including other sites), which is why that particular CSS doesn't use drupal_add_css() as this call requires that the file is located in the local server.
However, since a few releases ago, the security team forced me to make sure that the file is located in the Drupal server, so there's no reason not to use drupal_add_css() anymore. I'll take a look into doing it soon.
Comment #6
jcnventura CreditAttribution: jcnventura commentedThe module is now using drupal_add_css to include the custom CSS file, so the rtl version of the file will get called when needed if Drupal detects it.
João