diff options
author | 2024-01-18 12:28:22 +0800 | |
---|---|---|
committer | 2024-01-18 12:28:22 +0800 | |
commit | 15503b438c181053fa16884098c7ba1a57139303 (patch) | |
tree | f043f9b7f8e7933b72bbf7cc1d253e05b57208c2 /pydis_site | |
parent | Dark: Use original light theme colors everywhere (diff) |
Temporary fix to theme-switching FOUC problem
Diffstat (limited to 'pydis_site')
-rw-r--r-- | pydis_site/static/js/base/themes.js | 9 | ||||
-rw-r--r-- | pydis_site/templates/base/base.html | 1 |
2 files changed, 3 insertions, 7 deletions
diff --git a/pydis_site/static/js/base/themes.js b/pydis_site/static/js/base/themes.js index c5de8d91..fa7b9cf6 100644 --- a/pydis_site/static/js/base/themes.js +++ b/pydis_site/static/js/base/themes.js @@ -1,8 +1,7 @@ "use strict"; const defaultTheme = "light"; -const lightStylesheet = document.getElementById("bulma-css"); -const darkStylesheet = document.getElementById("bulma-css-dark"); +const stylesheet = document.getElementById("bulma-css"); // Get saved preference for the site in local storage, optionally accounting // for system preference used when a page loads. @@ -22,12 +21,10 @@ function getCurrentTheme(systemPrefers) { function setStyleSheets(newTheme) { switch (newTheme) { case "light": - lightStylesheet.rel = "stylesheet"; - darkStylesheet.rel = "stylesheet alternate"; + stylesheet.href = "/static/css/bulma.css"; break; case "dark": - darkStylesheet.rel = "stylesheet"; - lightStylesheet.rel = "stylesheet alternate"; + stylesheet.href = "/static/css/dark_bulma.css"; break; } diff --git a/pydis_site/templates/base/base.html b/pydis_site/templates/base/base.html index e497298a..bf58fb05 100644 --- a/pydis_site/templates/base/base.html +++ b/pydis_site/templates/base/base.html @@ -24,7 +24,6 @@ <title>Python Discord | {% block title %}Website{% endblock %}</title> {% bulma %} - {% bulma 'dark' include_js=False %} {% font_awesome %} <link rel="stylesheet" href="{% static "css/base/base.css" %}"> |