| 1 |
let OldValue = require('../old-value') |
| 2 |
let Value = require('../value') |
| 3 |
|
| 4 |
class Pixelated extends Value { |
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
old(prefix) { |
| 9 |
if (prefix === '-webkit-') { |
| 10 |
return new OldValue(this.name, '-webkit-optimize-contrast') |
| 11 |
} |
| 12 |
if (prefix === '-moz-') { |
| 13 |
return new OldValue(this.name, '-moz-crisp-edges') |
| 14 |
} |
| 15 |
return super.old(prefix) |
| 16 |
} |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
replace(string, prefix) { |
| 22 |
if (prefix === '-webkit-') { |
| 23 |
return string.replace(this.regexp(), '$1-webkit-optimize-contrast') |
| 24 |
} |
| 25 |
if (prefix === '-moz-') { |
| 26 |
return string.replace(this.regexp(), '$1-moz-crisp-edges') |
| 27 |
} |
| 28 |
return super.replace(string, prefix) |
| 29 |
} |
| 30 |
} |
| 31 |
|
| 32 |
Pixelated.names = ['pixelated'] |
| 33 |
|
| 34 |
module.exports = Pixelated |