Reputation: 205
In these days i'm struggling with the conversion from a react app to a react-native app; in this react app i used tailwind to stylize components thus i need to convert tailwind classes to inline css so that i can convert it to react native stylesheet using a tool online. Is there a way or tool to get css from Tailwind code?
i.e.
(Tailwind code) "w-full h-full bg-black
" after conversion should be (vanilla css) { width : 100%; height : 100%; background-color : black;
}
Thanks in advance!
Upvotes: 3
Views: 9058
Reputation: 59
This is a very specific scenario that has a very specific solution.
In a more general case (that you really want to extract the vanilla css of any HTML file using tailwindcss), there is a quick tutorial for that.
Extracting TailwindCSS from HTML
Upvotes: 0
Reputation: 205
The solution to this problem is : Tailwind-rn
(as Mando replied)
Thanks to this packet it is possible to copy the entire tailwind code from react project and paste it as param of the function tailwind()
which returns a react-native stylesheet object.
Here's the docs :
https://github.com/vadimdemedes/tailwind-rn
Upvotes: 2