hi.
I ran my code on android studio and nothing appeared on the screen(everything works in the browser).
Without shadow DOM, web components are displayed.
<body>
<chat-page></chat-page>
</body>
<script type="module">
import css from "./sheet.css" with { type: 'css' }; // #chat { width: 300px; height: 300px;border: red thin solid; }
customElements.define(`chat-page`, class extends HTMLElement {
constructor() {
super();
this.attachShadow({mode:"open"});
this.shadowRoot.adoptedStyleSheets = [css];
this.shadowRoot.innerHTML="<div id='chat'></div>";
}
}
</script>
1 post - 1 participant