Skip to content

Instantly share code, notes, and snippets.

@joshkitt
Created February 11, 2021 22:59
Show Gist options
  • Save joshkitt/445f02364cfd7dca7d443925a5cb1861 to your computer and use it in GitHub Desktop.
Save joshkitt/445f02364cfd7dca7d443925a5cb1861 to your computer and use it in GitHub Desktop.
Shadow dom css override
(function shadowLoop () {
var host = document.getElementsByTagName('host-element-containing-shadow-root)[0];
if (!host) {
setTimeout(shadowLoop, 500);
} else {
var style = document.createElement('style');
style.innerHTML = '#SomeID {display: none !important}';
host.shadowRoot.appendChild(style);
}
} ());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment