[fix] -ms- CSS vendor prefix

This commit is contained in:
Nicolas Gallagher
2015-10-19 16:02:41 -07:00
parent 83f749d983
commit 2c52d41b75
2 changed files with 5 additions and 2 deletions

View File

@@ -6,8 +6,11 @@ import hyphenate from '../hyphenate'
suite('modules/StyleSheet/hyphenate', () => {
test('style property', () => {
assert.equal(hyphenate('alignItems'), 'align-items')
assert.equal(hyphenate('color'), 'color')
})
test('vendor prefixed style property', () => {
assert.equal(hyphenate('WebkitAppearance'), '-webkit-appearance')
assert.equal(hyphenate('MozTransition'), '-moz-transition')
assert.equal(hyphenate('msTransition'), '-ms-transition')
assert.equal(hyphenate('WebkitTransition'), '-webkit-transition')
})
})

View File

@@ -1 +1 @@
export default (string) => string.replace(/([A-Z])/g, '-$1').toLowerCase()
export default (string) => (string.replace(/([A-Z])/g, '-$1').toLowerCase()).replace(/^ms-/, '-ms-')