MCPcopy
hub / github.com/GrapesJS/grapesjs / getPrefixedProp

Function getPrefixedProp

packages/core/src/utils/cash-dom.ts:391–411  ·  view source on GitHub ↗
(prop, isVariable)

Source from the content-addressed store, hash-verified

389 vendorsPrefixes = ['webkit', 'moz', 'ms', 'o'];
390
391function getPrefixedProp(prop, isVariable) {
392 if (isVariable === void 0) {
393 isVariable = isCSSVariable(prop);
394 }
395
396 if (isVariable) return prop;
397
398 if (!prefixedProps[prop]) {
399 var propCC = camelCase(prop),
400 propUC = '' + propCC.charAt(0).toUpperCase() + propCC.slice(1),
401 props = (propCC + ' ' + vendorsPrefixes.join(propUC + ' ') + propUC).split(' ');
402 each(props, function (p) {
403 if (p in style) {
404 prefixedProps[prop] = p;
405 return false;
406 }
407 });
408 }
409
410 return prefixedProps[prop];
411}
412
413cash.prefixedProp = getPrefixedProp; // @require core/type_checking.js
414// @require ./is_css_variable.js

Callers 1

cash-dom.tsFile · 0.85

Calls 3

isCSSVariableFunction · 0.85
eachFunction · 0.85
camelCaseFunction · 0.70

Tested by

no test coverage detected