From 3abcde4f8e50646d5d11f48c2943c03b7d8ac482 Mon Sep 17 00:00:00 2001 From: Ludovic Fernandez Date: Sat, 30 Aug 2025 10:07:09 +0200 Subject: [PATCH] fix: move dir attribute to :root (#805) --- assets/js/switcher-menu.js | 2 +- layouts/baseof.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/js/switcher-menu.js b/assets/js/switcher-menu.js index 49074bd..9619905 100644 --- a/assets/js/switcher-menu.js +++ b/assets/js/switcher-menu.js @@ -8,7 +8,7 @@ function computeMenuTranslation(switcher, optionsElement) { const isOnTop = switcher.dataset.location === 'top'; const isOnBottom = switcher.dataset.location === 'bottom'; const isOnBottomRight = switcher.dataset.location === 'bottom-right'; - const isRTL = document.body.dir === 'rtl' + const isRTL = document.documentElement.dir === 'rtl' // Stuck on the left side of the switcher. let x = switcherRect.left; diff --git a/layouts/baseof.html b/layouts/baseof.html index 5ae5e0d..d97e3c7 100644 --- a/layouts/baseof.html +++ b/layouts/baseof.html @@ -1,7 +1,7 @@ - + {{- partial "head.html" . -}} - + {{- partial "banner.html" . -}} {{- partial "navbar.html" . -}} {{- block "main" . }}{{ end -}}