Skip to content

Commit 89a0b86

Browse files
Remove bare value handling for perspective utilities (#13288)
* Remove bare value handling for perspective utilities * move `perspective-123` example This is now moved to the spot where we ensure that nothing is generated at all. This prevents us from accidentally updating a snapshot and missing a potential bug. * update changelog --------- Co-authored-by: Adam Wathan <[email protected]> Co-authored-by: Robin Malfait <[email protected]>
1 parent d25fe81 commit 89a0b86

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
### Added
1111

1212
- Add `inherit` as a universal color ([#13258](https://github.com/tailwindlabs/tailwindcss/pull/13258))
13-
- Add 3D transform utilities ([#13248](https://github.com/tailwindlabs/tailwindcss/pull/13248))
13+
- Add 3D transform utilities ([#13248](https://github.com/tailwindlabs/tailwindcss/pull/13248), [#13288](https://github.com/tailwindlabs/tailwindcss/pull/13288))
1414

1515
### Fixed
1616

packages/tailwindcss/src/utilities.test.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3128,24 +3128,14 @@ test('perspective', () => {
31283128
}
31293129
@tailwind utilities;
31303130
`,
3131-
[
3132-
'perspective-normal',
3133-
'perspective-dramatic',
3134-
'perspective-none',
3135-
'perspective-123',
3136-
'perspective-[456px]',
3137-
],
3131+
['perspective-normal', 'perspective-dramatic', 'perspective-none', 'perspective-[456px]'],
31383132
),
31393133
).toMatchInlineSnapshot(`
31403134
":root {
31413135
--perspective-dramatic: 100px;
31423136
--perspective-normal: 500px;
31433137
}
31443138
3145-
.perspective-123 {
3146-
perspective: 123px;
3147-
}
3148-
31493139
.perspective-\\[456px\\] {
31503140
perspective: 456px;
31513141
}
@@ -3162,7 +3152,7 @@ test('perspective', () => {
31623152
perspective: 500px;
31633153
}"
31643154
`)
3165-
expect(run(['perspective', '-perspective', 'perspective-potato'])).toEqual('')
3155+
expect(run(['perspective', '-perspective', 'perspective-potato', 'perspective-123'])).toEqual('')
31663156
})
31673157

31683158
test('cursor', () => {

packages/tailwindcss/src/utilities.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1501,10 +1501,6 @@ export function createUtilities(theme: Theme) {
15011501
staticUtility('perspective-none', [['perspective', 'none']])
15021502
functionalUtility('perspective', {
15031503
themeKeys: ['--perspective'],
1504-
handleBareValue: ({ value }) => {
1505-
if (!Number.isInteger(Number(value))) return null
1506-
return `${value}px`
1507-
},
15081504
handle: (value) => [decl('perspective', value)],
15091505
})
15101506

0 commit comments

Comments
 (0)