system.menus-rtl.css still loads even if system.menus.css is disabled in .info file when viewing in rtl mode (tested using arabic).

adding..

stylesheets[all][] = system.menus-rtl.css

..to the .info file resolves this. Trivial to patch, so posting for your review.

Comments

johnalbin’s picture

Say what?

That has to be a core bug. :-\

johnalbin’s picture

Title: system.menus-rtl.css » RTL files still load even when removed via .info file
Priority: Normal » Major

I just searched core's queue and I'm not seeing an existing issue about this. Can someone confirm this behavior?

KrisBulman’s picture

StatusFileSize
new159.28 KB

Steps to reproduce:

  1. Enable locale module
  2. Visit /admin/config/regional/language
  3. Click add language and select a RTL language (I chose Arabic)
  4. Set your chosen RTL language as the default, save and close the overlay
  5. Inspect any collapsed element and see that system.menus-rtl.css is loading

system.menus-rtl-screenshot

KrisBulman’s picture

StatusFileSize
new202.68 KB

Adding stylesheets[all][] = system.menus-rtl.css to your .info file, and following the same steps will show that it does not load. (see screenshot)

system.menus-rtl-disabled-screenshot

KrisBulman’s picture

StatusFileSize
new942 bytes

Pending someone else being able to reproduce this problem, here is a patch. Documentation should probably be added if there is a core bug to link to ( I can open the ticket if no one has yet after confirmation ). I really hope it's something specific to my setup, and not a core bug though as it's a pretty annoying problem.

I thought of removing the RTL stylesheets the old way (in a function) if RTL is on.. I'm not actually sure it's possible without attempting it, but finding out which system stylesheets are being disabled just to disable concurrent RTL seems overkill.

KrisBulman’s picture

Tested in Stark, and confirmed that it is a core "bug". But likely just a documentation piece IMO.

#1785804: RTL stylesheets still load even when parent LTR ones are disabled in .info

KrisBulman’s picture

Hey John, I checked with Jacine and it turns out this IS a core bug, and none of the patches against it have been accepted.

See comment #74 in #575298: Provide non-PHP way to reliably override CSS where she states we still have to manually deal with RTL files. I closed the core ticket as a duplicate after finding this out.

Perhaps we should stick with hook_css_alter()?

Moving forward with this ticket #1549160: Implement Styles Options via hook_css_alter() seems the most appropriate, so I will be setting this ticket as needs work.

KrisBulman’s picture

Status: Needs review » Needs work
johnalbin’s picture

Status: Needs work » Closed (duplicate)

I reopened the core issue, #1785804: RTL stylesheets still load even when parent LTR ones are disabled in .info. It should be fixed there. Marking this as a dupe of that one.