diff --git a/packages/tailwindcss/preflight.css b/packages/tailwindcss/preflight.css index 753e79ef0d0f..60938c6a12c1 100644 --- a/packages/tailwindcss/preflight.css +++ b/packages/tailwindcss/preflight.css @@ -384,6 +384,15 @@ input:where([type='button'], [type='reset'], [type='submit']), height: auto; } +/* + Remove default max-width and max-height constraints on dialog elements in iOS Safari. +*/ + +dialog { + max-width: none; + max-height: none; +} + /* Make elements with the HTML hidden attribute stay hidden by default. */ diff --git a/packages/tailwindcss/tests/ui.spec.ts b/packages/tailwindcss/tests/ui.spec.ts index 0c3534efd748..312956d3569f 100644 --- a/packages/tailwindcss/tests/ui.spec.ts +++ b/packages/tailwindcss/tests/ui.spec.ts @@ -1472,6 +1472,16 @@ test('conic mask color can be changed on hover', async ({ page }) => { ]).toContain(await getPropertyValue('#x', 'mask-image')) }) +test('dialog elements have max-width and max-height reset by Preflight', async ({ page }) => { + let { getPropertyValue } = await render( + page, + html`Hello world`, + ) + + expect(await getPropertyValue('#x', 'max-width')).toEqual('none') + expect(await getPropertyValue('#x', 'max-height')).toEqual('none') +}) + test("::backdrop can receive a border with just the 'border' utility", async ({ page }) => { let { getPropertyValue } = await render( page,