1.0.4 • Published 6 months ago

cncn v1.0.4

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
6 months ago

cncn

  • Tailwind-Merge and CLSX NPM shortcut.
  • NPM CNCN
// Download
npm i cncn

// commonjs
const cn = require('cncn');
// esm
import cn from 'cncn';

// Examples
// class variables
const baseClasses = 'bg-blue-500 text-white';
const isActive = false;

// If classes clash, the last one wins.
cn('text-black', baseClasses, { 'bg-red-500': !isActive }); // 'text-white bg-red-500'
cn('text-black', baseClasses, !isActive && 'bg-red-500'); // 'text-white bg-red-500'

// Exported types
import { type CV, type CN } from 'cncn';
// CV shorthand for clsx type ClassValue. 'string | number | bigint | boolean | ClassArray | ClassDictionary | null | undefined'
// CN shorthand for type cn function. (...inputs: ClassValue[]) => string
1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago