Skip to content

Commit ee6f232

Browse files
committed
fix: update icon paths in theme toggle JavaScript
Update bootstrap-icons.svg paths from /images/ to /assets/images/ in the theme toggle script to fix 404 errors when switching themes.
1 parent a77f52d commit ee6f232

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

assets/js/toggle-color-mode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ document.addEventListener('DOMContentLoaded', () => {
1313
// In system mode, use the system's color scheme preference
1414
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
1515
actualTheme = prefersDark ? 'dark' : 'light';
16-
themeIcon.setAttribute('xlink:href', '/images/icons/bootstrap-icons.svg#circle-half');
16+
themeIcon.setAttribute('xlink:href', '/assets/images/icons/bootstrap-icons.svg#circle-half');
1717
} else if (theme === 'light') {
18-
themeIcon.setAttribute('xlink:href', '/images/icons/bootstrap-icons.svg#sun-fill');
18+
themeIcon.setAttribute('xlink:href', '/assets/images/icons/bootstrap-icons.svg#sun-fill');
1919
} else if (theme === 'dark') {
20-
themeIcon.setAttribute('xlink:href', '/images/icons/bootstrap-icons.svg#moon-stars-fill');
20+
themeIcon.setAttribute('xlink:href', '/assets/images/icons/bootstrap-icons.svg#moon-stars-fill');
2121
}
2222

2323
// Set the theme attribute on <html> (Bootstrap 5.3+)

0 commit comments

Comments
 (0)