dewmetime's picture
how can i get it to work correctly?
479a01e verified
raw
history blame contribute delete
648 Bytes
// Shared JavaScript across all pages
document.addEventListener('DOMContentLoaded', () => {
// Ensure Feather icons are properly replaced in Web Components
const replaceIconsInShadowRoot = () => {
document.querySelectorAll('*').forEach(element => {
if (element.shadowRoot) {
feather.replace({}, element.shadowRoot);
}
});
};
// Replace icons initially
replaceIconsInShadowRoot();
// Replace icons again after a short delay to ensure Web Components are loaded
setTimeout(replaceIconsInShadowRoot, 100);
setTimeout(replaceIconsInShadowRoot, 500);
});