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

feat(core): add ScopedStylesMixin #1613

Merged
merged 4 commits into from Mar 1, 2022
Merged

Conversation

jorenbroekema
Copy link
Collaborator

@jorenbroekema jorenbroekema commented Feb 28, 2022

What I did

  1. Abstract the scoped styles functionality to a generic mixin, moving it from input-range to core package
  2. Move tests pertaining to the scoped styles functionality in input-range to core as well
  3. SkipLibCheck true until Fulfill deprecation notice to simplify type delivery open-wc/open-wc#2411 & testing-helpers: types import html und unsafeStatic from "lit-html/static", but should import from "lit/static-html". open-wc/open-wc#2388 are resolved

I have a use case where I could really use this scoped styles mixin:
I got a custom-element which relies on tailwind (global stylesheet) so I must use createRenderRoot -> this and make it render to LightDOM. However, there's custom styles that I'd still prefer to have scoped to prevent style conflicts/leakages.

@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2022

🦋 Changeset detected

Latest commit: a338271

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@lion/core Patch
@lion/input-range Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@daKmoR
Copy link
Contributor

daKmoR commented Feb 28, 2022

I think that feature might be able to be implemented via an Lit controller...

care to try it out?

@gerjanvangeest
Copy link
Member

gerjanvangeest commented Feb 28, 2022

You also need to update the input-range docs:

To use it when extending, override `static rangeStyles(scope)`:

@jorenbroekema
Copy link
Collaborator Author

Hm yeah I'll give it a shot

@jorenbroekema
Copy link
Collaborator Author

Looks like I succeeded :)

@jorenbroekema jorenbroekema merged commit 77790ac into master Mar 1, 2022
@jorenbroekema jorenbroekema deleted the scoped-styles-mixin branch March 1, 2022 08:39
@jorenbroekema
Copy link
Collaborator Author

Ah crap I meant to squash and merge, 3 redundant commit messages now :P my bad

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

Successfully merging this pull request may close these issues.

None yet

3 participants