Skip to content

Commit 90e1850

Browse files
committed
feat (theme): isRTL, allow tests on tags other than html
1 parent daaf454 commit 90e1850

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/js/utils/isRTL.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export default function isRTL() {
2-
return (
3-
document.documentElement.dir === 'rtl' ||
4-
document.documentElement.lang === 'ar' ||
5-
document.documentElement.lang === 'iw'
6-
)
1+
export default function isRTL(container = document.documentElement) {
2+
return container.dir === 'rtl' || ['ar', 'iw'].includes(container.lang)
73
}

0 commit comments

Comments
 (0)