-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
); | ||
} | ||
} |