tw-can
TypeScript icon, indicating that this package has built-in type declarations

0.0.1 • Public • Published

tw-can

Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.

import { twCan } from 'tw-can'

twCan('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]', 'aspect-ratio border border-2', { '-mt-[4.3rem] z-50': 5 > 3 }, 'flex flex-col grid grid-5', {'grid bg-orange': false})
// → 'hover:bg-dark-red p-3 bg-[#B91C1C] aspect-ratio border border-2 -mt-[4.3rem] z-50 flex flex-col grid grid-5'

Get started

Package Sidebar

Install

npm i tw-can

Weekly Downloads

2

Version

0.0.1

License

MIT

Unpacked Size

13.6 kB

Total Files

12

Last publish

Collaborators

  • ryolambert