UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

30 lines (27 loc) 957 B
import { extendTailwindMerge } from 'tailwind-merge-v2'; import { extendTailwindMerge as extendTailwindMerge$1 } from 'tailwind-merge-v3'; import { getPrefix } from '../store/index.js'; import { getTailwindVersion } from './get-tailwind-version.js'; const cache = /* @__PURE__ */ new Map(); function twMerge(...classLists) { const prefix = getPrefix(); const version = getTailwindVersion(); const cacheKey = `${prefix}.${version}`; const cacheValue = cache.get(cacheKey); if (cacheValue) { return cacheValue(...classLists); } const twMergeFn = (version === 3 ? extendTailwindMerge : extendTailwindMerge$1)({ extend: { classGroups: { "bg-image": ["bg-arrow-down-icon", "bg-check-icon", "bg-dash-icon", "bg-dot-icon"], shadow: ["shadow-sm-light"] } }, prefix }); cache.set(cacheKey, twMergeFn); return twMergeFn(...classLists); } export { twMerge }; //# sourceMappingURL=tailwind-merge.js.map