Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
9 changes: 9 additions & 0 deletions packages/tailwindcss/preflight.css
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down
10 changes: 10 additions & 0 deletions packages/tailwindcss/tests/ui.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`<dialog id="x">Hello world</dialog>`,
)

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,
Expand Down