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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

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

### Fixed

Expand Down
14 changes: 2 additions & 12 deletions packages/tailwindcss/src/utilities.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3128,24 +3128,14 @@ test('perspective', () => {
}
@tailwind utilities;
`,
[
'perspective-normal',
'perspective-dramatic',
'perspective-none',
'perspective-123',
'perspective-[456px]',
],
['perspective-normal', 'perspective-dramatic', 'perspective-none', 'perspective-[456px]'],
),
).toMatchInlineSnapshot(`
":root {
--perspective-dramatic: 100px;
--perspective-normal: 500px;
}

.perspective-123 {
perspective: 123px;
}

Comment on lines -3145 to -3148
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should move the perspective-123 example to the expect below where we explicitly test that it doesn't generate anything.

.perspective-\\[456px\\] {
perspective: 456px;
}
Expand All @@ -3162,7 +3152,7 @@ test('perspective', () => {
perspective: 500px;
}"
`)
expect(run(['perspective', '-perspective', 'perspective-potato'])).toEqual('')
expect(run(['perspective', '-perspective', 'perspective-potato', 'perspective-123'])).toEqual('')
})

test('cursor', () => {
Expand Down
4 changes: 0 additions & 4 deletions packages/tailwindcss/src/utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1501,10 +1501,6 @@ export function createUtilities(theme: Theme) {
staticUtility('perspective-none', [['perspective', 'none']])
functionalUtility('perspective', {
themeKeys: ['--perspective'],
handleBareValue: ({ value }) => {
if (!Number.isInteger(Number(value))) return null
return `${value}px`
},
handle: (value) => [decl('perspective', value)],
})

Expand Down