feat: add comments and cleanup unused imports across codebase

This commit is contained in:
2026-05-10 20:00:04 +02:00
parent b152e246ff
commit e48d95cb4e
68 changed files with 560 additions and 88 deletions

View File

@@ -7,7 +7,7 @@ const getSavedTheme = (): Theme => {
if (raw === 'light' || raw === 'dark') {
return raw;
}
return 'dark';
return 'dark'; // default to dark
};
const applyTheme = (theme: Theme): void => {
@@ -25,6 +25,7 @@ const initTheme = (): void => {
const saved = getSavedTheme();
applyTheme(saved);
// delegated click handler on theme buttons
document.addEventListener('click', e => {
const target = e.target as HTMLElement;
const btn = target.closest('#theme-toggle, #footer-theme-toggle') as HTMLButtonElement | null;