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

Support styled-jss #81

Closed
hendrul opened this issue Feb 4, 2018 · 5 comments
Closed

Support styled-jss #81

hendrul opened this issue Feb 4, 2018 · 5 comments

Comments

@hendrul
Copy link

hendrul commented Feb 4, 2018

styled-jss is near to have support for function rules in this PR, the added docs here explain how to add multiple function rules, like the great ones you offer in this wonderful lib... is it posible to support their theming api?... In my case I'm using material-ui v1 and they select react-jss as their CSSinJS engine of choice for performance reasons (and other reasons) they explain here and here. It would be awesome to be able to use the same api as styled-components and have this utility methods playing nice together.

@jxnblk
Copy link
Member

jxnblk commented Feb 4, 2018

Unless theme is passed as a prop (which it looks like it's still only in context here https://github.com/cssinjs/styled-jss/pull/35/files#diff-04c6e90faac2675aa89e2176d2eec7d8R66), styled-system won't be able to pick up the theme values. That said, I don't see why this styled-jss library shouldn't work like every other styled-components clone

@hendrul
Copy link
Author

hendrul commented Feb 5, 2018

Yes with the PR they are passing the theme, look at the end of the PR,

+const Button = styled('button')((props, {theme}) => ({
+  color: theme.color,
+  'background-color': theme.backgroundColor,

@jxnblk
Copy link
Member

jxnblk commented Feb 5, 2018

Right, what I’m saying is that the convention is to pass context values as props rather than leaving them on the context object

@jxnblk
Copy link
Member

jxnblk commented Feb 18, 2018

Closing this out. Again, styled-system should work with any CSS-in-JS library that passes props.theme as a convention

@jxnblk jxnblk closed this as completed Feb 18, 2018
@lttb
Copy link

lttb commented Mar 2, 2018

@hendrul just to note, we've decided to move on with props.theme convention, so theming support had been released in v2.2.0

there is an example with styled-system: https://codesandbox.io/s/0p156o834n

@jxnblk btw awesome project, thanks!

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

No branches or pull requests

3 participants