Sha256: 5166752d7a728c54d7710af32c140336dc783f1f64561e23d6d1c783c26567a4
Contents?: true
Size: 1.02 KB
Versions: 7
Compression:
Stored size: 1.02 KB
Contents
var prefixes = ['-webkit-', '-moz-', '-ms-'] /** * Binding for CSS styles */ module.exports = { bind: function () { var prop = this.arg if (!prop) return if (prop.charAt(0) === '$') { // properties that start with $ will be auto-prefixed prop = prop.slice(1) this.prefixed = true } this.prop = prop }, update: function (value) { var prop = this.prop if (prop) { var isImportant = value.slice(-10) === '!important' ? 'important' : '' if (isImportant) { value = value.slice(0, -10).trim() } this.el.style.setProperty(prop, value, isImportant) if (this.prefixed) { var i = prefixes.length while (i--) { this.el.style.setProperty(prefixes[i] + prop, value, isImportant) } } } else { this.el.style.cssText = value } } }
Version data entries
7 entries across 7 versions & 1 rubygems