Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Shadow DOM #27

Open
prantlf opened this issue Feb 17, 2021 · 1 comment
Open

Add support for Shadow DOM #27

prantlf opened this issue Feb 17, 2021 · 1 comment

Comments

@prantlf
Copy link
Contributor

prantlf commented Feb 17, 2021

Would you accept a minimum implementation of [ShadowRoot] and [attachShadow] for the purposes of taking part in toString of HTMLElement? It helps using dom-lite in unit tests of web components. I have an implementation in 30 LOC.

It could be either added to index.js to be always available, or left outside to be required separately. The separate require would modify the prototype of HTMLElement.

const { document } = require('dom-lite')
require('dom-lite/shadow-dom') // inject the implementation

Adding it to index.js would make the usage easier, providing the tiny size of the implementation.

What do you think?

[ShadowRoot https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot
[attachShadow]: https://developer.mozilla.org/en-US/docs/Web/API/Element/attachShadow

@lauriro
Copy link
Member

lauriro commented Feb 18, 2021

Show me the code! :)
I updated readme with minimal contribution section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants