I think it happened in #228818: IE: Stylesheets ignored after 31 link/style tags but I guess there was no point in reopening that old and closed issue.
What happens is that RTL style sheets get @imported in the end of the group and not immediately after their LTR counterpart.
that means that if you have a parent theme and a sub-theme and they have parent.css, parent-rtl.css, child.css, child-rtl.css respectively.
you would expect :
<style type="text/css" media="all">
@import url(" ... /parent.css");
@import url(" ... /parent-rtl.css");
@import url(" ... /child.css");
@import url(" ... /child-rtl.css");
</style>
but instead you would get :
<style type="text/css" media="all">
@import url(" ... /parent.css");
@import url(" ... /child.css");
@import url(" ... /parent-rtl.css");
@import url(" ... /child-rtl.css");
</style>
This way there is no for a themer to override parent-rtl.css from child.css. There are work-arounds but this feels like a bug.
Comments
Comment #1
tsi commentedStumbled again over this issue, but this time there's a patch, D7 & D8.
This is very important for styles cascading, without it they are totally broken and you must resort to increased specificity (bad).
Comment #3
tsi commented#1: rtl-overrides-weights-1372170.patch queued for re-testing.
Comment #4
tsi commented#1: D7-rtl-overrides-weights-1372170.patch queued for re-testing.
[EDIT] - nevermind this one, it is being tested against D8 :(
Comment #6
yakoub commentedchanging wight increment won't change the order because parent.css and child.css have weight 0 and group CSS_THEME so when hook_css_alter runs then parent-rtl.css and child-rtl.css will get same weight of 0+0.1 or 0+000.1 doesn't matter how small the incr
what should happen in drupal_add_css is adding by default a weight that is incremented by 1 and then for example parent.css will get weight = 10 and child.css weight=11 and in hook_css_alter parent-rtl weight will be 10.01 and child-rtl.css 11.01
but that is difficult to implement and not worth the trouble :) .. just use child-rtl.css for your overrides and not child.css
Comment #7
tsi commented@yakoub, we already do.
http://api.drupal.org/api/drupal/core%21includes%21common.inc/function/d...
Comment #8
yakoub commentedyes i missed it :)
Comment #9
tsi commentedSo do you think it is RTBC ? I can't review my own patch...
Comment #10
tsi commentedI would mark this "needs review" but the bot will fail over the D7 patch. anyway, no work to be done here...
Comment #11
sunLooks good.
An additional inline comment to explain the very small value plus a reference to essentially what #7 referred to would have been great to prevent this mistake from happening in the future, but I guess it's also fine without.
Comment #12
catchIt should be possible to add a test for this.
Comment #12.0
catchMinor fixes for readability in English.
Comment #13
joelpittetWe don't do this anymore!!! whoo. There is no -rtl files. We've put CSS selectors.
[dir='rtl']selectos everywhere.