source: node_modules/autoprefixer/lib/hacks/pixelated.js@ 2058e5c

Last change on this file since 2058e5c was 2058e5c, checked in by istevanoska <ilinastevanoska@…>, 6 months ago

Working / before login

  • Property mode set to 100644
File size: 819 bytes
RevLine 
[2058e5c]1let OldValue = require('../old-value')
2let Value = require('../value')
3
4class Pixelated extends Value {
5 /**
6 * Different name for WebKit and Firefox
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 * Use non-standard name for WebKit and Firefox
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
32Pixelated.names = ['pixelated']
33
34module.exports = Pixelated
Note: See TracBrowser for help on using the repository browser.