diff --git a/build.js b/build.js index 755f2ddf..f6036cdd 100644 --- a/build.js +++ b/build.js @@ -15,9 +15,7 @@ async function init() { const distRoot = './dist'; const pagesRoot = './docs/pages'; const pages = await fs.readdir(new URL(pagesRoot, import.meta.url)); - const { html } = await renderToString(new URL('./docs/layout.js', import.meta.url), { - lightMode: true - }); + const { html } = await renderToString(new URL('./docs/layout.js', import.meta.url)); await fs.rm(distRoot, { recursive: true, force: true }); await fs.mkdir(distRoot, { recursive: true }); diff --git a/docs/components/footer.js b/docs/components/footer.js index b2b251a2..4a36ad59 100644 --- a/docs/components/footer.js +++ b/docs/components/footer.js @@ -30,10 +30,7 @@ template.innerHTML = ` class Footer extends HTMLElement { connectedCallback() { - if (!this.shadowRoot) { - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(template.content.cloneNode(true)); - } + this.innerHTML = template.content.textContent; } } diff --git a/docs/components/header.js b/docs/components/header.js index 01c2a3a1..4c54f45d 100644 --- a/docs/components/header.js +++ b/docs/components/header.js @@ -61,10 +61,7 @@ template.innerHTML = ` class Header extends HTMLElement { connectedCallback() { - if (!this.shadowRoot) { - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(template.content.cloneNode(true)); - } + this.innerHTML = template.content.textContent; } } diff --git a/docs/components/navigation.js b/docs/components/navigation.js index 35ff41c7..731bc3dc 100644 --- a/docs/components/navigation.js +++ b/docs/components/navigation.js @@ -35,10 +35,7 @@ template.innerHTML = ` class Navigation extends HTMLElement { connectedCallback() { - if (!this.shadowRoot) { - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(template.content.cloneNode(true)); - } + this.innerHTML = template.content.textContent; } } diff --git a/docs/layout.js b/docs/layout.js index 12e40a0f..08a6740c 100644 --- a/docs/layout.js +++ b/docs/layout.js @@ -36,12 +36,8 @@ template.innerHTML = ` `; class Layout extends HTMLElement { - connectedCallback() { - if (!this.shadowRoot) { - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(template.content.cloneNode(true)); - } + this.innerHTML = template.content.textContent; } } diff --git a/docs/pages/docs.md b/docs/pages/docs.md index edebd3e2..141cf224 100644 --- a/docs/pages/docs.md +++ b/docs/pages/docs.md @@ -75,21 +75,6 @@ const { html } = await renderFromHTML(` For example, even if `Header` or `Footer` use `import` to pull in additional custom elements, only the `Header` and `Footer custom elements used in the "entry" HTML are needed in the array. -### Options - -`renderToString` and `renderFromHTML` also supports a second and third parameter respectively, that is an object, called `options` -```js -// default values -{ - lightMode: false -} -``` - -It supports the following configuration(s): - -- `lightMode`: For more static outcomes (e.g. no declarative shadow DOM), this option will omit all wrapping `