cssstyle icon indicating copy to clipboard operation
cssstyle copied to clipboard

"webkit-*" vs "-webkit-*"

Open mcjazzyfunky opened this issue 7 years ago • 6 comments

It seems there's a problem with the webkit prefixes (leading "-"). I think it should be -webkit-transform, not webkit-transform.

The following code shows the issue:

const
  cssstyle = require('cssstyle'),
  style = new cssstyle.CSSStyleDeclaration();

style.cssText = 'background-color: red; -webkit-transform: scale(2);'

// Be aware: Using "-webkit-transform" with leading "-"
console.log('background-color: ' + style.backgroundColor)  // working => "red"
console.log('-webkit-transform: ' + style.webkitTransform) // not working => "" <---------- !!!!


// Be aware: Using "webkit-transform" now, without leading "-"
style.cssText = 'background-color: green; webkit-transform: scale(3);'

console.log('background-color: ' + style.backgroundColor)  // working => "green"
console.log('webkit-transform: ' + style.webkitTransform) // working => "scale(3)"

mcjazzyfunky avatar Aug 20 '18 12:08 mcjazzyfunky

This issue should be fixed with #112

nyroDev avatar Nov 23 '23 14:11 nyroDev