diff options
author | 2024-01-05 17:31:11 +0800 | |
---|---|---|
committer | 2024-01-05 18:11:00 +0800 | |
commit | 7b5435a9855111dd34422ff0067c1955c43875eb (patch) | |
tree | e535072810586006d03129ee47ef0dbbe04dcb1d /pydis_site/static/js | |
parent | Dark: Support system color scheme preference (diff) |
Dark: Fix hero colors on homepage
We can now use `[data-theme="dark"]` selector in CSS to defined styles
specifically for dark mode. This follows common web dev patterns and
gives little overhead.
- Hero
- Added `wave_black` SVG which copies `wave_white` as is but uses the
site's dark mode background color.
Diffstat (limited to 'pydis_site/static/js')
-rw-r--r-- | pydis_site/static/js/base/navbar.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pydis_site/static/js/base/navbar.js b/pydis_site/static/js/base/navbar.js index 04850add..2a57cad4 100644 --- a/pydis_site/static/js/base/navbar.js +++ b/pydis_site/static/js/base/navbar.js @@ -30,6 +30,8 @@ function setStyleSheets(newTheme) { darkStylesheet.disabled = false; break; } + + document.querySelector("html").setAttribute("data-theme", newTheme); } // Reflect chosen theme on the switch toggle. |