skip to Main Content

Javascript – How can access the specific html tag inside of slot in light DOM through the shadow DOM?

I've created a custom element and defined it in html as follows: ` <header> <custom-navbar links="[{title:'home'},{title:'About'}]" class="bg-purple"> <h1 slot="logo"> Amazon </h1> <navbar slot="link" class="navbar-wrapper"> <ul class="link-container"> </ul> </navbar> </custom-navbar> </header> ` An I've defined my custom element as follows: class…

VIEW QUESTION

Html – How to add stylesheet to shadow dom?

I am using web components. I have the following html structure <div class="test"> #shadow-root (open) <overlay-trigger type="modal"> <div id = "login-dialog"> #shadow-root (open) <div id = "modal"> I have the following code const styleString = String(styles); const style = document.createElement("style");…

VIEW QUESTION
Back To Top
Search