source: imaps-frontend/node_modules/inline-style-prefixer/es/plugins/calc.js@ d565449

main
Last change on this file since d565449 was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 381 bytes
Line 
1import { isPrefixedValue } from 'css-in-js-utils';
2
3var CALC_REGEX = /calc\(/g;
4var prefixes = ['-webkit-', '-moz-', ''];
5
6export default function calc(property, value) {
7 if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('calc(') !== -1) {
8 return prefixes.map(function (prefix) {
9 return value.replace(CALC_REGEX, prefix + 'calc(');
10 });
11 }
12}
Note: See TracBrowser for help on using the repository browser.