diff options
| author | Gab Virebent <gabriel1@virebent.art> | 2026-07-02 03:58:31 +0200 |
|---|---|---|
| committer | Gab Virebent <gabriel1@virebent.art> | 2026-07-02 03:58:31 +0200 |
| commit | 52eb46afad75d76c707ed11bbddddbcf5e121deb (patch) | |
| tree | 728a5590c028e16a8a824274b7657b235439fea2 /static/theme-init.js | |
| parent | 4da18fe598f243c777d330ba9d50f1ecd4382b05 (diff) | |
| download | nymdrop-52eb46afad75d76c707ed11bbddddbcf5e121deb.tar.gz nymdrop-52eb46afad75d76c707ed11bbddddbcf5e121deb.tar.xz nymdrop-52eb46afad75d76c707ed11bbddddbcf5e121deb.zip | |
Add light/dark theme toggle, fix dark theme text contrast
Theme state persists via localStorage, applied pre-paint by theme-init.js
to avoid flash. All JS moved to external files (app.js, theme-init.js)
to keep script-src 'self' CSP intact, no inline scripts.
Dark theme footer/notice/tagline colors were too close to the background
(footer nearly matched the card border color) and hard to read; brightened
to readable grays while leaving the light theme and submit button untouched.
Diffstat (limited to 'static/theme-init.js')
| -rw-r--r-- | static/theme-init.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/static/theme-init.js b/static/theme-init.js new file mode 100644 index 0000000..95b9a95 --- /dev/null +++ b/static/theme-init.js @@ -0,0 +1,5 @@ +(function() { + if (localStorage.getItem('nymdrop-theme') === 'light') { + document.documentElement.setAttribute('data-theme', 'light'); + } +})(); |
