+ +This prefix will be used in some specific cases in which a ltr or rtl rule will override styles located in the main rule due to [specificty](https://developer.mozilla.org/en-US/docs/Web/CSS/Specificity). Consider the next example using the option `processUrls` as `true`: + +```css +.test1 { + background: url('icons/ltr/arrow.png'); + background-size: 10px 20px; + width: 10px; +} +``` + +The generated CSS would be: + +```css +.test1 { + background-size: 10px 20px; + width: 10px; +} + +[dir="ltr"] .test1 { + background: url('icons/ltr/arrow.png'); +} + +[dir="rtl"] .test1 { + background: url('icons/rtl/arrow.png'); +} +``` + +In the previous case, the `background-size` property has been overridden by the `background` one. Even if we change the order of the rules, the last ones have a higher specificty, so they will rule over the first one. + +To solve this, another rule will be created at the end using the `bothPrefix` parameter: + +```css +.test1 { + width: 10px; +} + +[dir="ltr"] .test1 { + background: url('icons/ltr/arrow.png'); +} + +[dir="rtl"] .test1 { + background: url('icons/rtl/arrow.png'); +} + +[dir] { + background-size: 10px 20px; +} +``` + +And no matter the direction, the `background-size` property is respected. + +
+ +