Skip to content

Instantly share code, notes, and snippets.

@fabiensebban
Created July 18, 2025 08:18
Show Gist options
  • Save fabiensebban/f55d13cfe881229e4b9745cbddeb0555 to your computer and use it in GitHub Desktop.
Save fabiensebban/f55d13cfe881229e4b9745cbddeb0555 to your computer and use it in GitHub Desktop.
function applyCSS() {
const wishlistButtons = document.querySelectorAll('ooo-wl-product-card-button');
const cssStyles = `
svg {
fill: var(--ooo-wl-product-card-button-icon-color, #000);
}
`;
if (wishlistButtons) {
// Create style element
wishlistButtons.forEach((wishlistButton) => {
// Append to shadow root
const style = document.createElement('style');
style.textContent = cssStyles;
wishlistButton.shadowRoot.appendChild(style);
})
}
}
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', applyCSS);
} else {
applyCSS();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment