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.
19 lines
487 B
19 lines
487 B
'use strict';
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = calc;
|
|
|
|
var _cssInJsUtils = require('css-in-js-utils');
|
|
|
|
var CALC_REGEX = /calc\(/g;
|
|
var prefixes = ['-webkit-', '-moz-', ''];
|
|
|
|
function calc(property, value) {
|
|
if (typeof value === 'string' && !(0, _cssInJsUtils.isPrefixedValue)(value) && value.indexOf('calc(') !== -1) {
|
|
return prefixes.map(function (prefix) {
|
|
return value.replace(CALC_REGEX, prefix + 'calc(');
|
|
});
|
|
}
|
|
} |