getting started
- Welcome
- Installation
- Browser support
- Performances
features
- Styling
- Styling props
- Theming
- Plugins
- Breakpoints
- SSR
- Production
css utilities
- Installation
- Methods
- Flex
- Grid
- Margin
- Padding
guides
- Using with Next.js
- Using with Create-react-app
- Using with Gatsby
- Using with TailwindCSS
Using with TailwindCSS
You can easily use TailwindCSS along with Nifty. To add Tailwind class to a Nifty style, do the same as if you were using class names.
Write them after the declaration of the styles in a string
:
css({
background: '@bg',
}, 'p-4 rounded-full');
To keep all the styles from Tailwind when purging, you will need to add or modify the path to the files containing the Nifty styles in the tailwind.config.js
file:
// tailwind.config.js
module.exports = {
// If the files with Nifty styles are in the
// componentsfolder and are JavaScript files
purge: ['./components/**/*.js'],
// If the files with Nifty styles are in the
// components folder and are TypeScript files
purge: ['./components/**/*.ts'],
// ...
};