preact-custom-element
preact-custom-element copied to clipboard
Add support for {mode: 'closed'}
The current implementation of register(..., {shadow: true})
, always attaches the shadow DOM in {mode: 'open'}
. This is a request to add support for {mode: 'closed'}
as well.
Relevant docs: https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM#basic_usage
I'm happy to send a PR to support the above. The way I see it there are two options:
-
In addition to the option
{shadow: true}
, add support for{shadow: 'open'}
and{shadow: 'closed'}
. -
Add a new option called
mode
, e.g.:{shadow: true, mode: 'closed'}
.
Let me know which option is preferred and I'm happy to send over the PR, including updating the @types/
package.