https://i.sstatic.net/lBZqx.png
ShadowRoot(open)
I am looking to adjust the z-index property within this ShadowRoot.
host = document.getElementById("shadow-root");
var style = document.createElement( 'style' )
style.innerHTML = '.rssapp { z-index: -1; }'
host.shadowRoot.appendChild( style )
// var sheet = new CSSStyleSheet
// sheet.replaceSync( `.rssapp { z-index: -1 }`)
// host.shadowRoot.adoptedStyleSheets = [ sheet ]
Despite trying the code above, with both the commented portions and uncommented ones, I keep encountering the error message:
Uncaught TypeError: Cannot read property 'shadowRoot' of null
at script.js:35
(anonymous)
or
Uncaught TypeError: Cannot read property 'shadowRoot' of null
at script.js:38
(anonymous) respectively
Edit: I also attempted using the id XQqyAJD0d17SWeNW.