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 shadowdom/webcomponents #121

Open
phun-ky opened this issue Jun 9, 2021 · 2 comments
Open

Add support for shadowdom/webcomponents #121

phun-ky opened this issue Jun 9, 2021 · 2 comments

Comments

@phun-ky
Copy link

phun-ky commented Jun 9, 2021

Is it possible to add support for usage with shadow DOM / webcomponents?

@ten1seven
Copy link
Owner

Hi @phun-ky, I honestly haven't done any work with the shadow DOM. Do you have some specific use cases that could help me think through both of these requests?

@ten1seven ten1seven self-assigned this Jun 9, 2021
@phun-ky
Copy link
Author

phun-ky commented Jun 10, 2021

Basically, we have a webcomponent rendered like this in the DOM:

Screenshot from 2021-06-10 08-53-05

And this is the focus styling. This is usually in an external css (with link), but since the selector will never "penetrate" the webcomponent (shadow dom, scoped), it is not having an effect.

Screenshot from 2021-06-10 08-52-54

However, I modified the whatinput script to be included in the webcomponent (which is pretty heavy tbh, since it has to be included for every web component in a page), so it works.

Link to the webcomponent code: https://gist.github.com/phun-ky/1b0a91552b13e20de6c150f667a6d26f
Link to modified whatinput: https://gist.github.com/phun-ky/efd8785690ab3279a43d2da7bc634a40

Basically allowing to send in a global instead of using window, and use that same global as the anchor for the attributes required.

I removed some polyfill stuff and the sessionStorage stuff, since It's not needed for my use case.

@ten1seven ten1seven removed their assignment Jul 2, 2024
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