This is an automated email from the ASF dual-hosted git repository.
shahar pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow-site.git
The following commit(s) were added to refs/heads/main by this push:
new 40da9569e3 Fix dark mode button on production (#1371)
40da9569e3 is described below
commit 40da9569e3add2d289434fc0ac39a58fcca0429a
Author: Shahar Epstein <[email protected]>
AuthorDate: Sat Jan 3 19:53:42 2026 +0200
Fix dark mode button on production (#1371)
---
landing-pages/site/assets/js/dark-mode.js | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/landing-pages/site/assets/js/dark-mode.js
b/landing-pages/site/assets/js/dark-mode.js
index 856cb6ff0b..32e183200f 100644
--- a/landing-pages/site/assets/js/dark-mode.js
+++ b/landing-pages/site/assets/js/dark-mode.js
@@ -30,7 +30,7 @@
(() => {
'use strict'
- const themeKey = 'td-color-theme'
+ const themeKey = 'theme'
const getStoredTheme = () => localStorage.getItem(themeKey)
const setStoredTheme = theme => localStorage.setItem(themeKey, theme)
@@ -103,7 +103,7 @@
}
})
- window.addEventListener('DOMContentLoaded', () => {
+ const init = () => {
showActiveTheme(getPreferredTheme())
document.querySelectorAll('[data-bs-theme-value]')
@@ -115,5 +115,11 @@
showActiveTheme(theme, true)
})
})
- })
+ }
+
+ if (document.readyState === 'loading') {
+ window.addEventListener('DOMContentLoaded', init)
+ } else {
+ init()
+ }
})()