TailwindCSS is "a Utility-First CSS Framework for Rapid UI Development". It comes with a lot of great modular helpers that are very familiar to those coming from Rebass or Bootstrap.
These steps assume a structure similar to create-react-app
and should closely follow the installation instruction for TailwindCSS itself
- add
tailwindcss
to your project:yarn add tailwindcss
- create a tailwind configuration:
./node_modules/.bin/tailwind init ./config
- add the tailwind plugin to
post-css
:
{
loader: require.resolve('postcss-loader'),
options: {
...
plugins: () => [
require('tailwindcss')('./config/tailwind.js'),
...
]
}
}
- add the tailwind directives you want to your entry stylesheet:
@tailwind preflight;
@tailwind components;
@tailwind utilities;