8 ms·
It is a little more complicated because you have to omit the previous rule as well (and overriding it may interfere with other CSS rules), so it should be:
by ivanca 11y ago
It is a little more complicated because you have to omit the previous rule as well (and overriding it may interfere with other CSS rules), so it should be:
.some-class {
&[dir="rtl"] { margin-right: 1em; }
&:not([dir="rtl"]) {
margin-left: 1em;
}
}
- realityking 11y agoPart of the problem is, that it's highly undesirable having to mark every node as rtl, when it should just be inerited. Eventually (https://developer.mozilla.org/en-US/docs/Web/CSS/%3Adir https://developer.mozilla.org/en-US/docs/Web/CSS/%3Adir) will be able to write it like this: .some-class { &:dir(rtl) { margin-right: 1em; } &:dir(ltr) { margin-left: 1em; } } Right now it's probably easiest to load an additional stylesheet when a RTL language is used.