提交 7ad40e0e 编写于 作者: Q qiang

fix: weex-styler shorthandParser update transition parser

上级 840b92c8
......@@ -39,7 +39,9 @@ function transition (declaration) {
map['transition-delay'].push((match[4] || '0s').trim())
}
for (var key in map) {
result.push(generateDeclaration(key, map[key].join(', '), important, position))
var value = map[key]
value = value.find(item => item !== value[0]) ? value.join(', ') : value[0]
result.push(generateDeclaration(key, value, important, position))
}
}
return result
......
......@@ -73,6 +73,36 @@ describe('shorthand-parser', function () {
value: '0s, 1s, 0s',
position: {}
}])
expect(shorthandParser([{
type: 'declaration',
property: 'transition',
value: 'width 2s, height 2s',
position: {}
}])).eql([{
type: 'declaration',
property: 'transition-property',
value: 'width, height',
position: {}
},
{
type: 'declaration',
property: 'transition-duration',
value: '2s',
position: {}
},
{
type: 'declaration',
property: 'transition-timing-function',
value: 'ease',
position: {}
},
{
type: 'declaration',
property: 'transition-delay',
value: '0s',
position: {}
}])
})
it('parse margin', function () {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册