MCPcopy
hub / github.com/dcastil/tailwind-merge

github.com/dcastil/tailwind-merge @v3.6.0 sqlite

repository ↗ · DeepWiki ↗ · release v3.6.0 ↗
146 symbols 379 edges 56 files 7 documented · 5%
README
<a href="https://github.com/dcastil/tailwind-merge">
    <img src="https://github.com/dcastil/tailwind-merge/raw/v3.6.0/assets/logo.svg" alt="tailwind-merge" height="150px" />
</a>

tailwind-merge

Utility function to efficiently merge Tailwind CSS classes in JS without style conflicts.

import { twMerge } from 'tailwind-merge'

twMerge('px-2 py-1 bg-red hover:bg-dark-red', 'p-3 bg-[#B91C1C]')
// → 'hover:bg-dark-red p-3 bg-[#B91C1C]'

Get started

Extension points exported contracts — how you extend this code

ConfigStaticPart (Interface)
* The static part of the tailwind-merge configuration. When merging multiple configurations, the properties of this inte
src/lib/types.ts
MemoryStats (Interface)
(no doc)
tests/tw-merge.benchmark.ts
ConfigGroupsPart (Interface)
* The dynamic part of the tailwind-merge configuration. When merging multiple configurations, the user can choose to eit
src/lib/types.ts
ClassPartObject (Interface)
(no doc)
src/lib/class-group-utils.ts
ClassValidatorObject (Interface)
(no doc)
src/lib/class-group-utils.ts
LruCache (Interface)
(no doc)
src/lib/lru-cache.ts

Core symbols most depended-on inside this repo

tailwindMerge
called by 71
src/lib/create-tailwind-merge.ts
scaleColor
called by 51
src/lib/default-config.ts
scaleUnambiguousSpacing
called by 50
src/lib/default-config.ts
fromTheme
called by 36
src/lib/from-theme.ts
twJoin
called by 24
src/lib/tw-join.ts
extendTailwindMerge
called by 21
src/lib/extend-tailwind-merge.ts
scaleMaskImagePosition
called by 18
src/lib/default-config.ts
isTshirtSize
called by 17
src/lib/validators.ts

Shape

Function 130
Interface 12
Method 4

Languages

TypeScript100%

Modules by API surface

src/lib/validators.ts39 symbols
src/lib/default-config.ts33 symbols
src/lib/class-group-utils.ts18 symbols
src/lib/types.ts10 symbols
src/lib/lru-cache.ts7 symbols
tests/tw-merge.benchmark.ts5 symbols
src/lib/merge-configs.ts5 symbols
scripts/update-readme.mjs5 symbols
src/lib/parse-class-name.ts3 symbols
src/lib/create-tailwind-merge.ts3 symbols
tests/public-api.test.ts2 symbols
src/lib/tw-join.ts2 symbols

Dependencies from manifests, versioned

@babel/core7.29.0 · 1×
@babel/preset-env7.29.3 · 1×
@codspeed/vitest-plugin5.4.0 · 1×
@rollup/plugin-babel7.0.0 · 1×
@rollup/plugin-node-resolve16.0.3 · 1×
@rollup/plugin-typescript12.3.0 · 1×
@types/node24.12.2 · 1×
@vitest/coverage-v84.1.5 · 1×
@vitest/eslint-plugin1.6.16 · 1×
babel-plugin-annotate-pure-calls0.5.0 · 1×
babel-plugin-polyfill-regenerator0.6.8 · 1×
eslint9.39.4 · 1×

For agents

$ claude mcp add tailwind-merge \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact