Open bugfolder opened 12 months ago
The above is not quite right. The *-rtl.css files are deltas, not replacements; i.e., they should be loaded in addition to the non-RTL css files.
And there are several modules that have *-rtl.css files, including:
None of these files are loaded anywhere in Ubercart.
Typically, a CSS file is either included in the .info file, or loaded via something like this:
backdrop_add_css(backdrop_get_path('module', 'uc_cart') . '/css/uc_cart.css');
Since we would need to check the language anywhere we're loading a file that has an RTL version, I suggest we create a utility routine that we can call to load a CSS file that automatically checks the language and, if appropriate, looks for a file with an -rtl
suffix and loads that as well. Then we can go through all of Ubercart and replace backdrop_add_css()
with our utility function.
@bugfolder, this sounds like a good plan to me.
The uc_cart submodule contains CSS files for RTL:
uc_cart_block-rtl.css
uc_cart-rtl.css
But I don't see anywhere in the code that actually loads these.
Should we be doing something like this in all the places where we currently load the non-RTL files?