Support custom styles
This commit is contained in:
parent
d0df158fcf
commit
6a3cc4f7c6
6 changed files with 35 additions and 3 deletions
|
@ -22,6 +22,7 @@ class TabGroup extends HTMLElement {
|
|||
|
||||
// Create custom element
|
||||
const shadow = this.attachShadow({mode: "open"});
|
||||
this.shadow = shadow;
|
||||
|
||||
const wrapper = document.createElement("div");
|
||||
wrapper.setAttribute("class", "etabs");
|
||||
|
@ -77,6 +78,14 @@ class TabGroup extends HTMLElement {
|
|||
this.emit("ready", this);
|
||||
}
|
||||
|
||||
connectedCallback () {
|
||||
const style = this.querySelector("style");
|
||||
if (style) {
|
||||
const clone = style.cloneNode(this);
|
||||
this.shadow.appendChild(clone);
|
||||
}
|
||||
}
|
||||
|
||||
setDefaultTab (tab) {
|
||||
this.options.defaultTab = tab;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue