| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Use Tailwind in React Native
// In
import tw from '@ecreeth/tw.macro'
const buttonStyles = tw`bg-transparent text-sm text-blue-500`
// Out
const buttonStyles = {
backgroundColor: 'transparent',
fontSize: 14,
color: '#4299e1'
}npm install -D @ecreeth/tw.macro babel-plugin-macros
# or
yarn add @ecreeth/tw.macro babel-plugin-macros -DEnable Babel macros by adding "macros" to the plugin configuration:
{
"plugins": ["macros"]
}You can customize the default styles and even add your own. There are two ways to do:
"babelMacros": {
"tailwind": {
"file": "./my_personal_styles.json"
}
},{
"bg-black": {
"backgroundColor": "black"
},
"bg-personal": {
"backgroundColor": "coral"
}
}This configuration file can be any of the following:
Go to codesandbox for see this example
This project stemmed from tailwind-rn and twin.macro
| Back | FazBrowse Home | New Git URL |