createEngine (merge-engine/engine.ts)

tailwind-variants · src/internal/merge-engine/engine.ts · typescript · MIT
ui

High-performance Tailwind class merger with conflict resolution and caching.

// Source: https://github.com/heroui-inc/tailwind-variants | License: MIT | Copyright 2020 Tailwind Variants
// Provided via justclaw.it.com; keep this notice with the code.
/*
 * Compiled-table merge engine, vendored from shadcn-ui/cn (MIT). Conflict
 * rules follow tailwind-merge; the argument cache follows cnfast.
 *
 * Based on cn@0.2.5, synced through cn@0.5.0: the merge grammar and the
 * literal-set table encoding carry cn#74 (0.2.6), and `wrapClsx` carries the
 * churn-resistant argument cache from cn#152 (0.3.3). Local deltas: an unlabeled `font-[Inter]` is a
 * font family and `font-[700]` a weight (Tailwind v4, cn#23), and `cn(0)`
 * keeps "0" like `cx`. Copied as a unit: scan/classify/claim/emit, the join
 * layer, and `wrapClsx` are upstream code, not rewrites.
 *
 * @see http

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key