Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Ensure `not-*` does not remove `:is(…)` from variants ([#16825](https://github.com/tailwindlabs/tailwindcss/pull/16825))
- Ensure `@keyframes` are correctly emitted when using a prefixed setup ([#16850](https://github.com/tailwindlabs/tailwindcss/pull/16850))

### Changed

- Removed `max-w-auto` and `max-h-auto` utilities as they generate invalid CSS ([#16917](https://github.com/tailwindlabs/tailwindcss/pull/16917))

## [4.0.9] - 2025-02-25

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5110,7 +5110,6 @@ exports[`getClassList 1`] = `
"max-h-9/12",
"max-h-10/12",
"max-h-11/12",
"max-h-auto",
"max-h-dvh",
"max-h-dvw",
"max-h-fit",
Expand Down Expand Up @@ -5158,7 +5157,6 @@ exports[`getClassList 1`] = `
"max-w-72",
"max-w-80",
"max-w-96",
"max-w-auto",
"max-w-dvh",
"max-w-dvw",
"max-w-fit",
Expand Down
17 changes: 5 additions & 12 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2738,8 +2738,8 @@ test('min-width', async () => {
@tailwind utilities;
`,
[
'min-w-auto',
'min-w-full',
'min-w-auto',
'min-w-min',
'min-w-max',
'min-w-fit',
Expand Down Expand Up @@ -2813,16 +2813,7 @@ test('max-width', async () => {
}
@tailwind utilities;
`,
[
'max-w-none',
'max-w-full',
'max-w-max',
'max-w-max',
'max-w-fit',
'max-w-4',
'max-w-xl',
'max-w-[4px]',
],
['max-w-none', 'max-w-full', 'max-w-max', 'max-w-fit', 'max-w-4', 'max-w-xl', 'max-w-[4px]'],
),
).toMatchInlineSnapshot(`
":root, :host {
Expand Down Expand Up @@ -2861,6 +2852,7 @@ test('max-width', async () => {
expect(
await run([
'max-w',
'max-w-auto',
'-max-w-4',
'-max-w-[4px]',
'max-w-none/foo',
Expand Down Expand Up @@ -2988,8 +2980,8 @@ test('min-height', async () => {
@tailwind utilities;
`,
[
'min-h-auto',
'min-h-full',
'min-h-auto',
'min-h-screen',
'min-h-svh',
'min-h-lvh',
Expand Down Expand Up @@ -3145,6 +3137,7 @@ test('max-height', async () => {
expect(
await run([
'max-h',
'max-h-auto',
'-max-h-4',
'-max-h-[4px]',
'max-h-none/foo',
Expand Down
8 changes: 5 additions & 3 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,13 @@ export function createUtilities(theme: Theme) {
['height', value],
])
staticUtility(`w-${key}`, [['width', value]])
staticUtility(`min-w-${key}`, [['min-width', value]])
staticUtility(`max-w-${key}`, [['max-width', value]])
staticUtility(`h-${key}`, [['height', value]])
staticUtility(`min-w-${key}`, [['min-width', value]])
staticUtility(`min-h-${key}`, [['min-height', value]])
staticUtility(`max-h-${key}`, [['max-height', value]])
if (key !== 'auto') {
staticUtility(`max-w-${key}`, [['max-width', value]])
staticUtility(`max-h-${key}`, [['max-height', value]])
}
}

staticUtility(`w-screen`, [['width', '100vw']])
Expand Down