Skip to content

Commit cb518f4

Browse files
Set browser targets for iOS Safari, Firefox, and Chrome (#15166)
Closes #15160 We need to set browser targets for each browser individually to see vendor prefixes created for each browser. Exact values are up for discussion, this first pass is taken from @adamwathan's comments in #15160 --------- Co-authored-by: Adam Wathan <[email protected]>
1 parent 8217b5c commit cb518f4

File tree

8 files changed

+57
-15
lines changed

8 files changed

+57
-15
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
### Fixed
1111

12+
- Ensure any necessary vendor prefixes are generated for iOS Safari, Firefox, and Chrome ([#15166](https://github.com/tailwindlabs/tailwindcss/pull/15166))
1213
- Ensure `.group` and `.peer` are prefixed when using the `prefix(…)` option ([#15174](https://github.com/tailwindlabs/tailwindcss/pull/15174))
1314
- Ensure 3D transforms render correctly in Safari ([#15179](https://github.com/tailwindlabs/tailwindcss/pull/15179))
1415

packages/@tailwindcss-cli/src/commands/build/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,9 @@ function optimizeCss(
437437
exclude: Features.LogicalProperties,
438438
targets: {
439439
safari: (16 << 16) | (4 << 8),
440+
ios_saf: (16 << 16) | (4 << 8),
441+
firefox: 128 << 16,
442+
chrome: 120 << 16,
440443
},
441444
errorRecovery: true,
442445
}).code

packages/@tailwindcss-postcss/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ function optimizeCss(
241241
exclude: Features.LogicalProperties,
242242
targets: {
243243
safari: (16 << 16) | (4 << 8),
244+
ios_saf: (16 << 16) | (4 << 8),
245+
firefox: 128 << 16,
246+
chrome: 120 << 16,
244247
},
245248
errorRecovery: true,
246249
}).code

packages/@tailwindcss-vite/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,9 @@ function optimizeCss(
342342
exclude: Features.LogicalProperties,
343343
targets: {
344344
safari: (16 << 16) | (4 << 8),
345+
ios_saf: (16 << 16) | (4 << 8),
346+
firefox: 128 << 16,
347+
chrome: 120 << 16,
345348
},
346349
errorRecovery: true,
347350
}).code

packages/tailwindcss/src/index.test.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,23 @@ describe('compiling CSS', () => {
151151
}"
152152
`)
153153
})
154+
155+
test('adds vendor prefixes', async () => {
156+
expect(
157+
await compileCss(
158+
css`
159+
@tailwind utilities;
160+
`,
161+
['[text-size-adjust:none]'],
162+
),
163+
).toMatchInlineSnapshot(`
164+
".\\[text-size-adjust\\:none\\] {
165+
-webkit-text-size-adjust: none;
166+
-moz-text-size-adjust: none;
167+
text-size-adjust: none;
168+
}"
169+
`)
170+
})
154171
})
155172

156173
describe('arbitrary properties', () => {

packages/tailwindcss/src/test-utils/run.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export function optimizeCss(
3131
exclude: Features.LogicalProperties,
3232
targets: {
3333
safari: (16 << 16) | (4 << 8),
34+
ios_saf: (16 << 16) | (4 << 8),
35+
firefox: 128 << 16,
36+
chrome: 120 << 16,
3437
},
3538
errorRecovery: true,
3639
}).code

packages/tailwindcss/src/utilities.test.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11803,22 +11803,22 @@ test('box-decoration', async () => {
1180311803
test('bg-clip', async () => {
1180411804
expect(await run(['bg-clip-border', 'bg-clip-padding', 'bg-clip-content', 'bg-clip-text']))
1180511805
.toMatchInlineSnapshot(`
11806-
".bg-clip-border {
11807-
background-clip: border-box;
11808-
}
11806+
".bg-clip-border {
11807+
background-clip: border-box;
11808+
}
1180911809
11810-
.bg-clip-content {
11811-
background-clip: content-box;
11812-
}
11810+
.bg-clip-content {
11811+
background-clip: content-box;
11812+
}
1181311813
11814-
.bg-clip-padding {
11815-
background-clip: padding-box;
11816-
}
11814+
.bg-clip-padding {
11815+
background-clip: padding-box;
11816+
}
1181711817
11818-
.bg-clip-text {
11819-
background-clip: text;
11820-
}"
11821-
`)
11818+
.bg-clip-text {
11819+
background-clip: text;
11820+
}"
11821+
`)
1182211822
expect(
1182311823
await run([
1182411824
'bg-clip',

packages/tailwindcss/src/variants.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ test('marker', async () => {
6262

6363
test('selection', async () => {
6464
expect(await run(['selection:flex'])).toMatchInlineSnapshot(`
65-
".selection\\:flex ::selection, .selection\\:flex::selection {
65+
".selection\\:flex ::selection {
66+
display: flex;
67+
}
68+
69+
.selection\\:flex::selection {
6670
display: flex;
6771
}"
6872
`)
@@ -2161,7 +2165,15 @@ test('variant order', async () => {
21612165
}
21622166
}
21632167
2164-
.first-letter\\:flex:first-letter, .first-line\\:flex:first-line, .marker\\:flex ::marker, .marker\\:flex::marker, .selection\\:flex ::selection, .selection\\:flex::selection {
2168+
.first-letter\\:flex:first-letter, .first-line\\:flex:first-line, .marker\\:flex ::marker, .marker\\:flex::marker {
2169+
display: flex;
2170+
}
2171+
2172+
.selection\\:flex ::selection {
2173+
display: flex;
2174+
}
2175+
2176+
.selection\\:flex::selection {
21652177
display: flex;
21662178
}
21672179

0 commit comments

Comments
 (0)