From a19224486dd45d59b20cb815166d1d5a22eadc7e Mon Sep 17 00:00:00 2001 From: Maxwell Barvian Date: Sun, 7 Jul 2024 13:29:59 -0700 Subject: [PATCH] Update to tailwind-merge 2.4.0 --- packages/tailwind-merge/package.json | 2 +- packages/tailwind-merge/src/index.ts | 11 +++++++++-- pnpm-lock.yaml | 27 +++++---------------------- site/pages/index.mdx | 2 -- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/packages/tailwind-merge/package.json b/packages/tailwind-merge/package.json index 743147b..779a96b 100644 --- a/packages/tailwind-merge/package.json +++ b/packages/tailwind-merge/package.json @@ -30,7 +30,7 @@ "prepublishOnly": "pnpm run build && pnpm run test" }, "peerDependencies": { - "tailwind-merge": "^2.3.0" + "tailwind-merge": "~2.4.0" }, "devDependencies": { "bun": "^1.1.17", diff --git a/packages/tailwind-merge/src/index.ts b/packages/tailwind-merge/src/index.ts index 96c0fba..2427e33 100644 --- a/packages/tailwind-merge/src/index.ts +++ b/packages/tailwind-merge/src/index.ts @@ -73,8 +73,15 @@ export function withFluid(config: Config) { return mergeConfigs(config, { extend: { - classGroups, - ignoredVariants: [(variant) => variant.startsWith('~')] + classGroups + }, + experimentalParseClassName({ className, parseClassName }) { + const parsed = parseClassName(className) + + return { + ...parsed, + modifiers: parsed.modifiers.filter((modifier) => !modifier.startsWith('~')) + } } }) } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 13d6871..a97f993 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -97,8 +97,8 @@ importers: packages/tailwind-merge: dependencies: tailwind-merge: - specifier: ^2.3.0 - version: 2.3.0 + specifier: ~2.4.0 + version: 2.4.0 devDependencies: '@types/bun': specifier: ^1.1.3 @@ -347,10 +347,6 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/runtime@7.24.7': - resolution: {integrity: sha512-UwgBRMjJP+xv857DCngvqXI3Iq6J4v0wXmwc6sapg+zyhbwmQX67LUEFrkK5tbyJ30jGuG3ZvWpBiB9LCy1kWw==} - engines: {node: '>=6.9.0'} - '@babel/template@7.23.9': resolution: {integrity: sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA==} engines: {node: '>=6.9.0'} @@ -1385,13 +1381,11 @@ packages: bun@1.1.10: resolution: {integrity: sha512-qOJXrQZSzJ5DbJMt47GZGWtUSmIkbwD7fPSN/XS/T46D4cTTnPK46QDHlyC8VD+Anvs6uKNwuwKIyB31kUdHmQ==} - cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true bun@1.1.17: resolution: {integrity: sha512-x2vUqI75XQ11Qxb3FzQCd/AkbA8A3AiJ35xfw49JeNgu0MTi0RCuW+1zOyFf5iJM0xU07LKf2H69n4ASuEqhtQ==} - cpu: [arm64, x64] os: [darwin, linux, win32] hasBin: true @@ -2838,9 +2832,6 @@ packages: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} - regenerator-runtime@0.14.1: - resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - rehype-parse@9.0.0: resolution: {integrity: sha512-WG7nfvmWWkCR++KEkZevZb/uw41E8TsH4DsY9UxsTbIXCVGbAs4S+r8FrQ+OtH5EEQAs+5UxKC42VinkmpA1Yw==} @@ -3139,8 +3130,8 @@ packages: resolution: {integrity: sha512-d8+wsh5TfPwqVzbm4/HCXC783/KPHV60NvwitJnyTA5lWn1elhXMNWhXGCJ7PwPa8qFUnyJNIyuIRt2mT0WMug==} engines: {node: '>=16'} - tailwind-merge@2.3.0: - resolution: {integrity: sha512-vkYrLpIP+lgR0tQCG6AP7zZXCTLc1Lnv/CCRT3BqJ9CZ3ui2++GPaGb1x/ILsINIMSYqqvrpqjUFsMNLlW99EA==} + tailwind-merge@2.4.0: + resolution: {integrity: sha512-49AwoOQNKdqKPd9CViyH5wJoSKsCDjUlzL8DxuGp3P1FsGY36NJDAa18jLZcaHAUUuTj+JB8IAo8zWgBNvBF7A==} tailwindcss@3.4.3: resolution: {integrity: sha512-U7sxQk/n397Bmx4JHbJx/iSOOv5G+II3f1kpLpY2QeUv5DcPdcTsYLlusZfq1NthHS1c1cZoyFmmkex1rzke0A==} @@ -3821,10 +3812,6 @@ snapshots: '@babel/plugin-syntax-jsx': 7.23.3(@babel/core@7.23.9) '@babel/types': 7.23.9 - '@babel/runtime@7.24.7': - dependencies: - regenerator-runtime: 0.14.1 - '@babel/template@7.23.9': dependencies: '@babel/code-frame': 7.23.5 @@ -6582,8 +6569,6 @@ snapshots: dependencies: picomatch: 2.3.1 - regenerator-runtime@0.14.1: {} - rehype-parse@9.0.0: dependencies: '@types/hast': 3.0.4 @@ -6994,9 +6979,7 @@ snapshots: magic-string: 0.30.7 periscopic: 3.1.0 - tailwind-merge@2.3.0: - dependencies: - '@babel/runtime': 7.24.7 + tailwind-merge@2.4.0: {} tailwindcss@3.4.3: dependencies: diff --git a/site/pages/index.mdx b/site/pages/index.mdx index 15bd701..33e6342 100644 --- a/site/pages/index.mdx +++ b/site/pages/index.mdx @@ -367,5 +367,3 @@ import { withFluid } from '@fluid-tailwind/tailwind-merge' export const twMerge = extendTailwindMerge(/* ... */, withFluid) ``` -{/* tailwind-merge currently doesn't merge the fluid variants (i.e. `~sm/lg:`, `~@sm/lg:`) correctly. */} -