Skip to content

Commit d0fe859

Browse files
committed
Fix issue #64
1 parent 6cb1a8c commit d0fe859

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

src/selectors.js

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,11 @@ const isRootSelector = (selector = '') => !!selector.match(/:root/);
88

99
const addDirToSelectors = (selectors = '', dir, options = {}) => {
1010
const {addPrefixToSelector, prefixType} = options;
11-
// we swap direction prefixes if we are converting rtl styles to ltr
12-
if (options.fromRTL) {
13-
switch (dir) {
14-
case 'rtl':
15-
dir = 'ltr';
16-
break;
17-
case 'ltr':
18-
dir = 'rtl';
19-
break;
20-
default:
21-
}
11+
12+
if ((options.fromRTL && dir === 'rtl') || (!options.fromRTL && dir === 'ltr')) {
13+
return selectors;
2214
}
15+
2316
const prefix = generatePrefixes(options)[prefixType].prefixes[dir];
2417
if (!prefix) return selectors;
2518

0 commit comments

Comments
 (0)