From dbf3c8f5cded9ed9f9cbdfe1326ab7ef8f58bd4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Cab=C3=A9?= Date: Mon, 14 Oct 2024 14:36:32 +0200 Subject: [PATCH] doc: fix dark mode "flashing" on page load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This hooks up the dark-mode-toggle-stylesheets-loader so that the dark mode styles are loaded immediately, rather than waiting for the page to load and then switching to dark mode. This prevents the "flashing" of light mode styles on page load. Fixes #79791 Signed-off-by: Benjamin Cabé --- doc/_templates/layout.html | 13 ++++++++++--- doc/conf.py | 1 - 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/doc/_templates/layout.html b/doc/_templates/layout.html index 8593fac6113..699c8ee9f36 100644 --- a/doc/_templates/layout.html +++ b/doc/_templates/layout.html @@ -28,7 +28,14 @@ {% endblock %} {% block extrahead %} - {# Light/Dark stylesheets added here due to https://github.com/readthedocs/sphinx_rtd_theme/issues/1100 #} - - + {# Use dark mode loader script to prevent "flashing" of the page on load. + As we need a