Skip to content

Commit 3abcde4

Browse files
authored
fix: move dir attribute to :root (#805)
1 parent 82e25c0 commit 3abcde4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

assets/js/switcher-menu.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function computeMenuTranslation(switcher, optionsElement) {
88
const isOnTop = switcher.dataset.location === 'top';
99
const isOnBottom = switcher.dataset.location === 'bottom';
1010
const isOnBottomRight = switcher.dataset.location === 'bottom-right';
11-
const isRTL = document.body.dir === 'rtl'
11+
const isRTL = document.documentElement.dir === 'rtl'
1212

1313
// Stuck on the left side of the switcher.
1414
let x = switcherRect.left;

layouts/baseof.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!DOCTYPE html>
2-
<html lang="{{ .Site.Language.Lang }}">
2+
<html lang="{{ .Site.Language.Lang }}" dir="{{ .Site.Language.LanguageDirection | default `ltr` }}">
33
{{- partial "head.html" . -}}
4-
<body dir="{{ .Site.Language.LanguageDirection | default `ltr` }}">
4+
<body>
55
{{- partial "banner.html" . -}}
66
{{- partial "navbar.html" . -}}
77
{{- block "main" . }}{{ end -}}

0 commit comments

Comments
 (0)