[WIP / Discussion] Allow for non-lit specific implementation
What I did
- Moved the
adoptStylescall to be a hook
EDIT: will also need to move static elementStyles out as well.
Why?
Ideally I would love to be able to use this mixin with any web component, and as far as I can tell this is really the only Lit-specific portion.
Technically this PR doesn't solve the problem, but if the base mixin has a hook to adopt styles, we could get a separate entrypoint for the Mixin for Lit-specific implementations with the actual adoptStyles implementation.
I didn't do it here because I figured I'd open it up to discussion first if this is a use-case you all would like to support and making sure I didn't miss anything along the way.
⚠️ No Changeset found
Latest commit: e92e617bbad84c4fedb2c5dc9bcba974448436f2
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The ScopedElementsMixin is indeed built for usage with LitElement, and depends on overriding lits createRenderRoot lifecycle method. Moving the adoptStyles function isn't going to be enough to make the mixin compatible with non-Lit elements, unless they also implement a similar lifecycle hook. ~I also don't think the adoptStyles function is actually an issue here, I think it would just noop when used with non-lit elements.~ Nope, looks like it does error on non-lit elements.