1.1.0 • Published 9 months ago
@kozento/ccc v1.1.0
Installation
npm install @kozento/ccc
Usage
Basic Example
let condition = 16
ccc("foo",
true && "bar",
false && "baz",
condition > 16 && "ccc"
)
// Returns "foo bar"
React / TSX Example
export default function Button({ type = "primary", size = "sm", children }: { type?: Type, size?: Size, children: React.ReactNode }) {
return (
<button className={ccc("px-4 h-8",
type === "primary" && "text-zinc-50 bg-zinc-950",
type === "secondary" && "text-zinc-950 bg-zinc-50",
size === "sm" && "h-8",
size === "md" && "h-10",
type === "lg" && "h-12"
)}>{{children}}</button>
)
}