1.1.0 • Published 9 months ago

@kozento/ccc v1.1.0

Weekly downloads
-
License
MIT
Repository
-
Last release
9 months ago

Banner

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>
    )
}
1.1.0

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago