Styled-jsx: use classes from 'utility libraries' like tailwindcss in styled-jsx

Created on 24 Feb 2018  路  3Comments  路  Source: vercel/styled-jsx

I'd like to do something like what babel-plugin-tailwind or tachyons-js makes possible, namely using utility classes from a library like tailwindcss directly in my components.

I've gone down a rabbit hole trying to understand what is necessary to make that possible with styled-jsx and would appreciate any suggestions.

Most helpful comment

For those of you that stumbled upon this and wished there was a link to the example mentioned above:

https://github.com/zeit/next.js/tree/canary/examples/with-tailwindcss

All 3 comments

I'm closing this b/c I see that using examples/with-tailwindcss I can use className and it just works.

For those of you that stumbled upon this and wished there was a link to the example mentioned above:

https://github.com/zeit/next.js/tree/canary/examples/with-tailwindcss

For those that still want to use @apply in styled-jsx blocks, see here: https://github.com/tailwindlabs/tailwindcss/issues/1234#issuecomment-631817677

Was this page helpful?
0 / 5 - 0 ratings