From 96f03ecf3b460b74a858658590576c3b344500a3 Mon Sep 17 00:00:00 2001 From: Dany Castillo <31006608+dcastil@users.noreply.github.com> Date: Thu, 21 Dec 2023 17:45:58 +0100 Subject: [PATCH] add spacing scale to `min-width`, `min-height` and `max-width` --- src/lib/default-config.ts | 8 ++++---- tests/tailwind-css-versions.test.ts | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/default-config.ts b/src/lib/default-config.ts index 01e391f2..52cce609 100644 --- a/src/lib/default-config.ts +++ b/src/lib/default-config.ts @@ -600,7 +600,7 @@ export function getDefaultConfig() { * Min-Width * @see https://tailwindcss.com/docs/min-width */ - 'min-w': [{ 'min-w': ['min', 'max', 'fit', isArbitraryValue, isLength] }], + 'min-w': [{ 'min-w': [isArbitraryValue, spacing, 'min', 'max', 'fit'] }], /** * Max-Width * @see https://tailwindcss.com/docs/max-width @@ -608,7 +608,8 @@ export function getDefaultConfig() { 'max-w': [ { 'max-w': [ - '0', + isArbitraryValue, + spacing, 'none', 'full', 'min', @@ -617,7 +618,6 @@ export function getDefaultConfig() { 'prose', { screen: [isTshirtSize] }, isTshirtSize, - isArbitraryValue, ], }, ], @@ -645,7 +645,7 @@ export function getDefaultConfig() { * @see https://tailwindcss.com/docs/min-height */ 'min-h': [ - { 'min-h': ['min', 'max', 'fit', 'svh', 'lvh', 'dvh', isLength, isArbitraryValue] }, + { 'min-h': [isArbitraryValue, spacing, 'min', 'max', 'fit', 'svh', 'lvh', 'dvh'] }, ], /** * Max-Height diff --git a/tests/tailwind-css-versions.test.ts b/tests/tailwind-css-versions.test.ts index 0e9b7bc9..3e8eab14 100644 --- a/tests/tailwind-css-versions.test.ts +++ b/tests/tailwind-css-versions.test.ts @@ -47,4 +47,5 @@ test('supports Tailwind CSS v3.4 features', () => { expect(twMerge('grid-cols-2 grid-cols-subgrid grid-rows-5 grid-rows-subgrid')).toBe( 'grid-cols-subgrid grid-rows-subgrid', ) + expect(twMerge('min-w-0 min-w-50 min-w-px max-w-0 max-w-50 max-w-px')).toBe('min-w-px max-w-px') })