数通智联化工云平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
819 B

2 years ago
let OldValue = require('../old-value')
let Value = require('../value')
class Pixelated extends Value {
/**
2 years ago
* Different name for WebKit and Firefox
2 years ago
*/
2 years ago
old(prefix) {
2 years ago
if (prefix === '-webkit-') {
2 years ago
return new OldValue(this.name, '-webkit-optimize-contrast')
2 years ago
}
if (prefix === '-moz-') {
2 years ago
return new OldValue(this.name, '-moz-crisp-edges')
2 years ago
}
2 years ago
return super.old(prefix)
2 years ago
}
/**
2 years ago
* Use non-standard name for WebKit and Firefox
2 years ago
*/
2 years ago
replace(string, prefix) {
2 years ago
if (prefix === '-webkit-') {
2 years ago
return string.replace(this.regexp(), '$1-webkit-optimize-contrast')
2 years ago
}
if (prefix === '-moz-') {
2 years ago
return string.replace(this.regexp(), '$1-moz-crisp-edges')
2 years ago
}
2 years ago
return super.replace(string, prefix)
2 years ago
}
}
Pixelated.names = ['pixelated']
module.exports = Pixelated