Skip to content

Commit

Permalink
add spacing scale to min-width, min-height and max-width
Browse files Browse the repository at this point in the history
  • Loading branch information
dcastil committed Dec 21, 2023
1 parent a37e24b commit 96f03ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -600,15 +600,16 @@ 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
*/
'max-w': [
{
'max-w': [
'0',
isArbitraryValue,
spacing,
'none',
'full',
'min',
Expand All @@ -617,7 +618,6 @@ export function getDefaultConfig() {
'prose',
{ screen: [isTshirtSize] },
isTshirtSize,
isArbitraryValue,
],
},
],
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions tests/tailwind-css-versions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
})

0 comments on commit 96f03ec

Please sign in to comment.