Skip to content

Commit

Permalink
Add missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
agjohnson committed Mar 21, 2024
1 parent 58844f2 commit 08bea40
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/js/application/elements.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { LitElement } from "lit";

/**
* LightDOMElement
*
* This is a helper class for using a light DOM with LitElement
* instead of a shadow DOM. Light DOM is what allows FUI styles
* to be used inside the element.
*
* Also adds some debugger helpers.
**/
export class LightDOMElement extends LitElement {
// Use light DOM with inherited styles instead of shadow DOM
createRenderRoot() {
return this;
}

// And some debugging calls
connectedCallback() {
super.connectedCallback();

console.debug("Setting up web component instance:", this.constructor.name);
}

disconnectedCallback() {
super.disconnectedCallback();

console.debug(
"Disconnecting web component instance:",
this.constructor.name,
);
}
}

0 comments on commit 08bea40

Please sign in to comment.