Skip to main content
Module

x/clazzx/mod.ts>clx

ClazzX is a small typesafe utility library for composing HTML classes.
Latest
variable clx
import { clx } from "https://deno.land/x/clazzx@1.0.0/mod.ts";

clx accepts any number of strings, booleans, undefined, null, or arrays of those types and returns a string of all truthy values.

Examples

Example 1

clx("text-3xl font-bold") // "text-3xl font-bold"
clx(["text-3xl", "font-bold"]) // "text-3xl font-bold"
clx(["text-3xl", undefined, null]) // "text-3xl"
clx("text-3xl", "font-bold") // "text-3xl font-bold"
clx("text-3xl", undefined, null) // "text-3xl"
clx(["text-3xl"], ["font-bold"]) // "text-3xl font-bold"

type

(...input: Array<Clx>) => string