]> danix's work - danix.xyz-2.git/commit
Fix theme toggle icon to always sync with actual page theme
authorDanilo M. <redacted>
Wed, 15 Apr 2026 19:48:54 +0000 (21:48 +0200)
committerDanilo M. <redacted>
Wed, 15 Apr 2026 19:48:54 +0000 (21:48 +0200)
commit134d00e5bd0f15113e256c8446931d830985fbf4
tree427e3ec1bdb513d7fcfeff605591c31adf9afe90
parent68afb3e96391ca5dea8c46764cf6bd8a33c9ebd7
Fix theme toggle icon to always sync with actual page theme

Replace Alpine.js conditional rendering with plain JavaScript that:
- Reads the actual theme class from the html element on page load
- Updates icon visibility based on the real DOM state, not internal state
- Handles navigation correctly since it checks the current class every time

This fixes the issue where navigating between pages caused the icon to
become out of sync with the actual theme being displayed.

Co-Authored-By: Claude Haiku 4.5 <redacted>
themes/danix-xyz-hacker/assets/js/theme-toggle.js
themes/danix-xyz-hacker/layouts/partials/header.html