Skip to content

Commit

Permalink
add transition-behavior utilities
Browse files Browse the repository at this point in the history
Co-authored-by: Luke Warlow <luke@warlow.dev>
  • Loading branch information
RobinMalfait and lukewarlow committed Apr 17, 2024
1 parent cc8c069 commit 42266ef
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
Expand Up @@ -1717,6 +1717,8 @@ exports[`getClassList 1`] = `
"transform-view",
"transition",
"transition-all",
"transition-allow-discrete",
"transition-behavior-normal",
"transition-colors",
"transition-none",
"transition-opacity",
Expand Down
13 changes: 13 additions & 0 deletions packages/tailwindcss/src/utilities.test.ts
Expand Up @@ -10475,6 +10475,19 @@ test('transition', () => {
).toEqual('')
})

test('transition-behavior', () => {
expect(run(['transition-allow-discrete', 'transition-behavior-normal'])).toMatchInlineSnapshot(`
".transition-allow-discrete {
transition-behavior: allow-discrete;
}
.transition-behavior-normal {
transition-behavior: normal;
}"
`)
expect(run(['-transition-allow-discrete', '-transition-behavior-normal'])).toEqual('')
})

test('delay', () => {
expect(run(['delay-123', 'delay-200', 'delay-[300ms]'])).toMatchInlineSnapshot(`
".delay-123 {
Expand Down
3 changes: 3 additions & 0 deletions packages/tailwindcss/src/utilities.ts
Expand Up @@ -3609,6 +3609,9 @@ export function createUtilities(theme: Theme) {
],
})

staticUtility('transition-allow-discrete', [['transition-behavior', 'allow-discrete']])
staticUtility('transition-behavior-normal', [['transition-behavior', 'normal']])

functionalUtility('delay', {
handleBareValue: ({ value }) => {
if (Number.isNaN(Number(value))) return null
Expand Down

0 comments on commit 42266ef

Please sign in to comment.