-
Notifications
You must be signed in to change notification settings - Fork 10
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
Shadow mode #19
Comments
Sure why not, how would this look? |
I was hoping you had an opinion about that :-D Something like withProperties would be the obvious choice but we shouldn't really stick more on that - I don't think so. Or maybe we should use more of a mixin-pattern? or have two seperate lit-element's that both enherits from a lit-base-element'ish.. do you see other ideas? |
I tried doing mixins.... but doing a JS mixin from TypeScript is apparently impossible... spent quite some time on this and found out that a lot of clever people had spent an equal amount of time and given up :-( |
Hi, I've been playing around with web components quite a lot. So it looks like this:
I found this as the only solution if i didn't make my base class into a mixin where i could check I'm not 100% sure on performance impact, but so far it seems good, but i'd like to hear if it's a bad idea, and why if so :) @kenchris Btw, great work on this project! I've used it as a great inspiration for creating my own library which is similar, but has optional renderers like preact or lit-html :) |
Why not just check if this.shadowRoot exists? You also shouldn't need this._root. I don't really see a problem with creating the root at this point as it should be a fast operation. |
@kenchris Thanks for the idea of checking if shadowRoot exists, it works flawlessly 👍 |
This is how PolymerLab's lit-element is doing it: To turn off shadow DOM:
|
I was thinking that maybe we should make the shadowRoot optional all together?
and maybe make the shadow-mode configurable (open/closed)?
The text was updated successfully, but these errors were encountered: