Skip to content

Commit

Permalink
fix arbitrary values
Browse files Browse the repository at this point in the history
  • Loading branch information
heidkaemper committed Jun 20, 2024
1 parent 65ba4cd commit 2db21c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 23 deletions.
6 changes: 0 additions & 6 deletions jest/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,6 @@ it('should add predefined animations', () => {
.animate-spin {
animation: spin var(--tw-animate-duration, 1s) var(--tw-animate-easing, linear) var(--tw-animate-delay, 0s) var(--tw-animate-iteration, infinite) var(--tw-animate-fill, none);
}
.animate-fade {
animation-composition: var(--tw-animate-composition);
}
.animate-spin {
animation-composition: var(--tw-animate-composition);
}
`)
})
})
18 changes: 1 addition & 17 deletions src/utilities/composition.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = ({ addUtilities, matchUtilities, theme }) => {
module.exports = ({ addUtilities }) => {
addUtilities({
'.animate-replace': {
'--tw-animate-composition': 'replace',
Expand All @@ -13,20 +13,4 @@ module.exports = ({ addUtilities, matchUtilities, theme }) => {
'animation-composition': 'var(--tw-animate-composition)',
},
})

matchUtilities({
animate: value => {
const properties = value.split(/ +(?![^(]*\))/g)

if (properties.includes('replace') || properties.includes('add') || properties.includes('accumulate')) {
return
}

return {
'animation-composition': 'var(--tw-animate-composition)',
}
},
}, {
values: theme('animation'),
})
}

0 comments on commit 2db21c9

Please sign in to comment.