Open FredrikMohag opened 6 days ago
The current dark mode toggle functionality can be improved for better consistency and error handling. Suggested improvements include:
Throw errors if elements (#darkModeToggleBtn, .toggle-text) are missing to aid in debugging.
Consistent use of localStorage by storing both "light" and "dark" themes, instead of removing the key for dark mode.
Add aria-pressed attribute to the toggle button for better accessibility.
Refactor to reduce duplicate DOM manipulations and improve readability.
Implementing these changes will make the toggle more robust and user-friendly.
Task has been completed. Send further to review.
@MandeepKS do you have the PR for these improvements?
The current dark mode toggle functionality can be improved for better consistency and error handling. Suggested improvements include:
Throw errors if elements (#darkModeToggleBtn, .toggle-text) are missing to aid in debugging.
Consistent use of localStorage by storing both "light" and "dark" themes, instead of removing the key for dark mode.
Add aria-pressed attribute to the toggle button for better accessibility.
Refactor to reduce duplicate DOM manipulations and improve readability.
Implementing these changes will make the toggle more robust and user-friendly.