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.
12 lines
381 B
12 lines
381 B
import { isPrefixedValue } from 'css-in-js-utils';
|
|
|
|
var CALC_REGEX = /calc\(/g;
|
|
var prefixes = ['-webkit-', '-moz-', ''];
|
|
|
|
export default function calc(property, value) {
|
|
if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('calc(') !== -1) {
|
|
return prefixes.map(function (prefix) {
|
|
return value.replace(CALC_REGEX, prefix + 'calc(');
|
|
});
|
|
}
|
|
} |