airajena opened a new pull request, #50:
URL: https://github.com/apache/fineract-site/pull/50

   ## Summary
   Simplified theme behavior on the Fineract site to follow browser/system 
preference by default, while keeping manual toggle support during the current 
session.
   
   ## What changed
   - Removed localStorage-based theme persistence.
   - On page load, theme now always starts from browser/OS preference 
(`prefers-color-scheme`).
   - Manual toggle still switches between dark/light and updates the icon 
correctly.
   - On browser reopen/reload, site returns to system theme (as requested).
   - Consolidated duplicate theme scripts into one clean implementation.
   
   ## Fixed error
   This also fixes the runtime error:
   
   `(index):1624 Uncaught TypeError: Cannot set properties of null (setting 
'textContent')`
   
   ### Root cause
   Old code attempted to update `.theme-text` even when that element did not 
exist.
   
   ### Fix
   - Removed `.theme-text` update path.
   - Added safe icon update flow that checks toggle/icon elements before 
setting `textContent`.
   
   ## Behavior now
   - Browser dark -> site dark on load.
   - Browser light -> site light on load.
   - Manual toggle changes theme immediately and icon updates.
   - Close/reopen browser -> site again follows system preference.
   
   
https://github.com/user-attachments/assets/9357011d-4b33-4886-9099-08ef716736c3
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to