A React-Static plugin that adds tailwind support
Installation
In an existing react-static site run:
$ yarn add react-static-plugin-tailwindcss -D
Then add the plugin to your static.config.js:
plugins: "react-static-plugin-tailwindcss";
Now you can add @tailwind directives to your .css files
@@@
CSS-in-JS
If you're wanting to use tailwind in conjuction with styled-components for example
yarn add tailwind.macro@next
static.config.js
plugins: "react-static-plugin-tailwindcss" cssInJs: true ;
Create a babel-plugin-macros.config.js file
moduleexports = tailwind: config: './tailwind.config.js' format: 'auto'
Now you can use the tw macro inside styled components
; const Header = styledh1` `;
Autoprefixer
If you already handle auto prefixer or dont want to use it
plugins: "react-static-plugin-tailwindcss" autoPrefixer: false ;