Skip to content

Commit aa86c5a

Browse files
authored
Merge pull request #169 from cssinjs/wrong-transition-parse/1204
Return parameters of transition/transition-property value as it's, if…
2 parents 4a9a16e + 108815a commit aa86c5a

File tree

3 files changed

+211
-133
lines changed

3 files changed

+211
-133
lines changed

src/supported-value.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ function prefixTransitionCallback(match, p1, p2) {
2525
if (p1 === 'var') return 'var'
2626
if (p1 === 'all') return 'all'
2727
if (p2 === 'all') return ', all'
28-
return p1 ? supportedProperty(p1) : `, ${supportedProperty(p2)}`
28+
const prefixedValue = p1 ? supportedProperty(p1) : `, ${supportedProperty(p2)}`
29+
if (!prefixedValue) return p1 || p2
30+
return prefixedValue
2931
}
3032

3133
if (isInBrowser) el = document.createElement('p')

src/supported-value.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ describe('css-vendor', () => {
4949
)
5050
})
5151

52+
it('should return dashed property value as it is', () => {
53+
expect(supportedValue('transition', 'ease-in-out 0.3s')).to.eql('ease-in-out 0.3s')
54+
})
55+
5256
it('should return custom CSS variable for transition property as it is', () => {
5357
expect(supportedValue('transition', 'var(--something)')).to.eql('var(--something)')
5458
})

0 commit comments

Comments
 (0)