-
Notifications
You must be signed in to change notification settings - Fork 0
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
Suggestion: lit-css support in styles / lit-html renderer #30
Comments
Hi @web-padawan! Thanks a lot for rating my work! Regarding About your questions:
// this is currently allowed
@styles('/styles/theme.css', '.test {color: red}')
class MyComponent extends HTMLElement {}
// this is currently disallowed
@styles('/styles/theme.css')
@styles('.test {color: red}')
class MyComponent extends HTMLElement {} However, I think it could be easily added. Comparing decorators with mixins I would say that decorators definitely have some advantages over mixins. The most important one: decorators don't pollute prototype chain. They changes current definition and don't create another one in between. It solves some issues I faced during development of this framework (it was based on mixins at the start). Well, decorators also:
You can do these things only with stage 2 decorators. Mixins and legacy decorators cannot do all points at once. |
@Lodin the benefit of using Thanks for the answer. I wasn't aware that |
Closing this for now, as it is rather a question and not an issue per se. I hope to be able to experiment with the corpuscule till the end of the year, and will report my findings, or maybe ask more questions. |
@web-padawan, BTW I think you can use const module = css`.test {color: red;}`
@styles(module.toString())
class MyComponent extends HTMLElement {} |
I have been following the progress in this repo for a while, so first of all must admit the great work (especially now when I'm looking through the docs). So let me submit an issue.
Looks like the
@style
is now accepting either CSS file or raw styles. This is handful, but there is an idea on my mind and I'm not sure where to implement it better.I would like to add support for lit-css, which is a good way of sharing styles in a way compatible with LitElement. It basically can be already used with raw styles.
Here is the example how it is done in
styled-lit-element
by the same author: https://github.com/lit-styles/lit-styles/blob/6bea874af7f7b0dc5f8f5e5e5095a68c724792b9/packages/styled-lit-element/src/StyledLitElementMixin.js#L18Questions:
styled-lit-element
does via decorators?The text was updated successfully, but these errors were encountered: