File tree Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Expand file tree Collapse file tree 3 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -40,3 +40,24 @@ function nextFrame() {
4040 } ) ;
4141}
4242
43+ const RTL_LANGUAGES = new Set ( [
44+ 'ar' ,
45+ 'he' ,
46+ 'fa' ,
47+ 'ur' ,
48+ 'ps' ,
49+ 'sd' ,
50+ 'ckb' ,
51+ 'prs' ,
52+ 'rhg' ,
53+ ] ) ;
54+
55+ function isRTL ( ) {
56+ const lang = (
57+ navigator . language ||
58+ navigator . userLanguage ||
59+ //(new Intl.DateTimeFormat()).resolvedOptions().locale ||
60+ ''
61+ ) . split ( '-' ) [ 0 ] ;
62+ return RTL_LANGUAGES . has ( lang ) ;
63+ }
Original file line number Diff line number Diff line change @@ -71,6 +71,7 @@ function actionCheckboxes(params) {
7171}
7272
7373window . addEventListener ( 'DOMContentLoaded' , async ( ) => {
74+ document . documentElement . classList . toggle ( 'rtl' , isRTL ( ) ) ;
7475 await configs . $loaded ;
7576 configs . $addObserver ( onConfigChanged ) ;
7677
Original file line number Diff line number Diff line change 1111 opacity : 0 ;
1212}
1313
14+ : root .rtl {
15+ direction : rtl;
16+ }
17+
1418p , ul {
1519 margin : 0 0 0.5em 0 ;
1620 padding : 0 ;
You can’t perform that action at this time.
0 commit comments