Skip to content

Newbie here: how to view the post-babel code that is generated by twin.macro? #278

Closed Answered by ben-rogerson
ChristineTham asked this question in Q&A
Discussion options

You must be logged in to vote

Great questions!

To view the transformed output you need to run the file through babel.

Once you’ve setup twin, you can run babel over the file like this:

npx babel index.js --out-file index-compiled.js

But to make this easier, you can use the twin-output-tester which is all setup and ready to go.

I am thinking it may be cool to transform a Tailwind component into theme-ui or chakra-ui and I was hoping there can be an automated way of doing that. Is this possible, or am I better off just writing the component from scratch using the Tailwind as a reference rather than automatic translation?

I believe you’ll need to convert the styling in those components manually as the code varies too m…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ChristineTham
Comment options

Answer selected by ChristineTham
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants