You can now write it directly in HTML (Part 2).
It uses a template tag with shadowrootmode=open.
The browser creates the shadow root during HTML parsing.
No client-side script is needed to display it.
#WebComponents #HTML #WebDev
1/3
You can now write it directly in HTML (Part 2).
It uses a template tag with shadowrootmode=open.
The browser creates the shadow root during HTML parsing.
No client-side script is needed to display it.
#WebComponents #HTML #WebDev
1/3
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode
The mode read-only property of the ShadowRoot specifies its mode — either open or closed. This defines whether or not the shadow root's internal features are accessible from JavaScript.
#webdev
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/mode
The mode read-only property of the ShadowRoot specifies its mode — either open or closed. This defines whether or not the shadow root's internal features are accessible from JavaScript.
#webdev
The
Live demo:
rawcdn.githack.com/lume/lume/0b...
The
Live demo:
rawcdn.githack.com/lume/lume/0b...
github.com/whatwg/dom/i...
github.com/whatwg/dom/i...
If you're not using a ShadowRoot, you could use MutationObserver as the standard way to observe children. It'll fire whenever children are ready or have changed.
If you're not using a ShadowRoot, you could use MutationObserver as the standard way to observe children. It'll fire whenever children are ready or have changed.
<lume-mesh ...>
<lume-shaderview-material />
</lume-mesh>
where <lume-shaderview-material> has <shaderview> in its ShadowRoot and makes a THREE.CanvasTexture
<lume-mesh ...>
<lume-shaderview-material />
</lume-mesh>
where <lume-shaderview-material> has <shaderview> in its ShadowRoot and makes a THREE.CanvasTexture
FYI it's referencing an element in ShadowRoot so perhaps that's related. It also doesn't happen consistently.
FYI it's referencing an element in ShadowRoot so perhaps that's related. It also doesn't happen consistently.
It basically forces you to override every commonly used CSS prop in your component.
I've ran into customers having `* { transition: all .25s }` in their stylesheet. 🫠
Luckily nowadays we have `shadowRoot` and `unset`.
It basically forces you to override every commonly used CSS prop in your component.
I've ran into customers having `* { transition: all .25s }` in their stylesheet. 🫠
Luckily nowadays we have `shadowRoot` and `unset`.
For example, conditionally loading a Video player gets really tricky when everything is a Svelte powered component in a Web Component.
Have to move forward, so opting for only the custom <file-pond> element for now.
For example, conditionally loading a Video player gets really tricky when everything is a Svelte powered component in a Web Component.
Have to move forward, so opting for only the custom <file-pond> element for now.