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

Theming solution for LitElement #907

Closed
nicolejadeyee opened this issue Feb 27, 2020 · 3 comments
Closed

Theming solution for LitElement #907

nicolejadeyee opened this issue Feb 27, 2020 · 3 comments

Comments

@nicolejadeyee
Copy link
Contributor

No description provided.

@chase-moskal
Copy link

hello!

i just wanted to share that in my case, i found applying a shared css theme to many shadow-dom lit-element components was no sweat

using a decorator called mixin-css, and a couple helper functions, theme-components and register-components, i can easily share a css theme across many components like this:

registerComponents(themeComponents(theme, components))
 //  ↑              ↑
 //  │              └——— apply the css theme to components
 //  │
 //  └—————————————————— register components via customElements.define

this pattern decouples each component from any particular theme, making themes for components easily swappable at a high level

  👋 chase

@motss
Copy link

motss commented Mar 16, 2020

IIUC, it basically achieves that using Constructible Stylesheets with fallback when needed.

@sorvell
Copy link
Member

sorvell commented Sep 8, 2022

Closing in favor of lit/rfcs#10

@sorvell sorvell closed this as completed Sep 8, 2022
@sorvell sorvell moved this to ✅ Done in Lit Project Board Sep 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

5 participants