blob: 263227c3b98e2be48f62bf8758966adcd8f5cb60 [file] [log] [blame]
<script>
class CustomElement extends HTMLElement {
constructor() {
super();
const shadow = this.attachShadow({ mode: 'open' });
const slot = document.createElement('slot');
const style = document.createElement('style');
style.textContent = `
:host {
text-decoration: underline;
}
`;
shadow.append(style, slot);
}
}
customElements.define('custom-element', CustomElement);
</script>
<custom-element>This should be underlined</custom-element>