Mirror: CSS prefixing helpers in less than 1KB 馃寛
at v1.0.1 583 B view raw
1import /* codegen */ '../scripts/generate-prefix-map'; 2 3export const prefixProperty = prop => { 4 const props = [prop]; 5 if (msPrefixRe.test(prop)) { 6 props.push(`-ms-${prop}`); 7 } else if (mozPrefixRe.test(prop)) { 8 props.push(`-moz-${prop}`); 9 } else if (webkitPrefixRe.test(prop)) { 10 props.push(`-webkit-${prop}`); 11 } 12 13 return props; 14}; 15 16export const prefixValue = (prop, value) => { 17 if ( 18 (prop === 'position' && value === 'sticky') || 19 (prop === 'background-clip' && value === 'text') 20 ) { 21 return `-webkit-${value}, ${value}`; 22 } 23 24 return value; 25};