Closed kof closed 7 years ago
...and glamor seem to like styled-components :D
Yes, styled-components also uses a part of glamor. Its just about providing different interfaces to people and make it more convenient. A much harder part is the entire dsl and testing and rendering. But people tend to pick the library just based on its public interface, so its important to provide different interfaces for different tastes.
yeah we'd need to find or write a super efficient parser to convert strings and from there jss would take over the preprocessing.
To clarify: this is not about an api with tagged template string literals. Its about the default glamor api, basically its just this, but mapped to higher level glamor api.
const sheet = jss.createStyleSheet()
const rule = sheet.addRule({
color: 'red'
})
<div className={rule.className}></div>
I think styled-components api #341 is more important, we may reopen this one if it becomes relevant.
@kof I really love JSS and the way it's working! We'd really like to use it in our project.
We have quite a large code base and used glamor
so far. But I fear that it's not actively developed anymore. And this is a risk for us.
I'd really like to write a plugin for JSS which enables us to use the same API as glamor
, so that we don't need to refactor our whole code base.
We're using glamor in this kind of fashion:
<div {...css({ color: 'red' } />
// or
<div {...stylemap.container} />
Could you give me a hint on how to approach this? Are there potential performance problems?
Thanks!
@dan-lee yes sure, I think it is better to have a chat, ping me on gitter or twitter
For anyone interested, I created glamor-jss
!
Please submit it to https://github.com/cssinjs/jss/blob/master/docs/projects.md
People seem to like glamor api, lets provide them a one using jss. It will be similar to aphrodisiac minimum lines of code.