From f0a5da2bf84818f2ac72b6272ee674bef6e6134c Mon Sep 17 00:00:00 2001 From: hedy Date: Thu, 18 Jan 2024 12:51:17 +0800 Subject: Optimistic fix for FOUC on initial site load --- pydis_site/static/js/base/themes.js | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'pydis_site/static/js/base/themes.js') diff --git a/pydis_site/static/js/base/themes.js b/pydis_site/static/js/base/themes.js index fa7b9cf6..f79b759d 100644 --- a/pydis_site/static/js/base/themes.js +++ b/pydis_site/static/js/base/themes.js @@ -3,6 +3,10 @@ const defaultTheme = "light"; const stylesheet = document.getElementById("bulma-css"); +// We include the dark stylesheet in base template to include the rel="preload", +// but remove the actual rel="stylesheet" element here because we won't need it. +document.getElementById("bulma-css-dark").remove(); + // Get saved preference for the site in local storage, optionally accounting // for system preference used when a page loads. function getCurrentTheme(systemPrefers) { -- cgit v1.2.3