Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
var gridAreaRuleIndex = gridAreaMedia ? css.index(gridAreaMedia) : css.index(gridAreaRule);
var value = gridArea.value; // found the data that matches grid-area identifier
var data = gridTemplatesData.filter(function (d) {
return d.allAreas.includes(value);
})[0];
if (!data) {
return true;
}
var lastArea = data.allAreas[data.allAreas.length - 1];
var selectorBySpace = list.space(gridAreaRule.selector);
var selectorByComma = list.comma(gridAreaRule.selector);
var selectorIsComplex = selectorBySpace.length > 1 && selectorBySpace.length > selectorByComma.length; // prevent doubling of prefixes
if (hasPrefixedRow) {
return false;
} // create the empty object with the key as the last area name
// e.g if we have templates with "a b c" values, "c" will be the last area
if (!rulesToInsert[lastArea]) {
rulesToInsert[lastArea] = {};
}
var lastRuleIsSet = false; // walk through every grid-template rule data
for (var _iterator2 = data.rules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref9;
}
// abort if we outside media rule and walking below our rule
// (we need to check ONLY the rules that are above)
if (!inMediaRule && isLookingDown) {
return false;
}
// abort if we're in the same rule
if (isEqual) {
return false;
}
// if we're inside media rule, we need to compare selectors
if (inMediaRule) {
var selectors = list.comma(nodeRule.selector);
var selectorIsFound = selectors.some(function (sel) {
if (sel === rule.selector) {
// compare selectors as a comma list
return true;
} else if (nodeRule.selector === rule.selector) {
// compare selectors as a whole (e.g. ".i, .j" === ".i, .j")
return true;
}
return false;
});
// stop walking if we found the selector
if (selectorIsFound) {
return false;
}
}
}
var gridAreaRuleIndex = gridAreaMedia ? css.index(gridAreaMedia) : css.index(gridAreaRule);
var value = gridArea.value; // found the data that matches grid-area identifier
var data = gridTemplatesData.filter(function (d) {
return d.allAreas.includes(value);
})[0];
if (!data) {
return true;
}
var lastArea = data.allAreas[data.allAreas.length - 1];
var selectorBySpace = list.space(gridAreaRule.selector);
var selectorByComma = list.comma(gridAreaRule.selector);
var selectorIsComplex = selectorBySpace.length > 1 && selectorBySpace.length > selectorByComma.length; // prevent doubling of prefixes
if (hasPrefixedRow) {
return false;
} // create the empty object with the key as the last area name
// e.g if we have templates with "a b c" values, "c" will be the last area
if (!rulesToInsert[lastArea]) {
rulesToInsert[lastArea] = {};
} // walk through every grid-template rule data
for (var _iterator2 = data.rules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref9;
}
var gridAreaRuleIndex = gridAreaMedia ? css.index(gridAreaMedia) : css.index(gridAreaRule);
var value = gridArea.value; // found the data that matches grid-area identifier
var data = gridTemplatesData.filter(function (d) {
return d.allAreas.includes(value);
})[0];
if (!data) {
return true;
}
var lastArea = data.allAreas[data.allAreas.length - 1];
var selectorBySpace = list.space(gridAreaRule.selector);
var selectorByComma = list.comma(gridAreaRule.selector);
var selectorIsComplex = selectorBySpace.length > 1 && selectorBySpace.length > selectorByComma.length; // prevent doubling of prefixes
if (hasPrefixedRow) {
return false;
} // create the empty object with the key as the last area name
// e.g if we have templates with "a b c" values, "c" will be the last area
if (!rulesToInsert[lastArea]) {
rulesToInsert[lastArea] = {};
}
var lastRuleIsSet = false; // walk through every grid-template rule data
for (var _iterator2 = data.rules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref9;
}
var gridAreaRuleIndex = gridAreaMedia ? css.index(gridAreaMedia) : css.index(gridAreaRule);
var value = gridArea.value; // found the data that matches grid-area identifier
var data = gridTemplatesData.filter(function (d) {
return d.allAreas.includes(value);
})[0];
if (!data) {
return true;
}
var lastArea = data.allAreas[data.allAreas.length - 1];
var selectorBySpace = list.space(gridAreaRule.selector);
var selectorByComma = list.comma(gridAreaRule.selector);
var selectorIsComplex = selectorBySpace.length > 1 && selectorBySpace.length > selectorByComma.length; // prevent doubling of prefixes
if (hasPrefixedRow) {
return false;
} // create the empty object with the key as the last area name
// e.g if we have templates with "a b c" values, "c" will be the last area
if (!rulesToInsert[lastArea]) {
rulesToInsert[lastArea] = {};
} // walk through every grid-template rule data
for (var _iterator2 = data.rules, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) {
var _ref9;
splitSelector (selector) {
return list
.comma(selector)
.map(i => {
return list.space(i).map(k => {
return k.split(/(?=\.|#)/g)
})
})
}
editList: function editList(value, callback) {
var origin = list.comma(value);
var changed = callback(origin, []);
if (origin === changed) {
return value;
}
var join = value.match(/,\s*/);
join = join ? join[0] : ', ';
return changed.join(join);
},
decl.parent.each(function (i) {
if (i.type !== 'decl') {
return undefined;
}
if (i.prop.indexOf('transition-') !== 0) {
return undefined;
}
if (i.prop === 'transition-property') {
return undefined;
}
if (list.comma(i.value).length > 1) {
decl.warn(result, 'Replace transition-property to transition, ' + 'because Autoprefixer could not support ' + 'any cases of transition-property ' + 'and other transition-*');
}
return false;
});
}
ruleSelectors = ruleSelectors.map(function (selector) {
var selectorBySpace = list.space(selector);
var selectorByComma = list.comma(selector);
if (selectorBySpace.length > selectorByComma.length) {
selector = selectorBySpace.slice(-1).join('');
}
return selector;
});
return ruleSelectors.map(function (ruleSelector) {
function splitProperty (rule, prop, opts) {
const {breakEvery, reindent, reduce, max} = {
reindent: false,
...opts,
};
const property = rule[prop];
if (!max || !property) {
return;
}
const exploded = list.comma(property);
if (property.length > max || reduce) {
let indent = 0;
if (typeof reindent === 'function') {
indent = reindent(rule);
}
rule[prop] = exploded.reduce((lines, chunk) => {
if (breakEvery) {
lines.push(chunk);
return lines;
}
if (lines[lines.length - 1].length + indent <= max) {
const merged = `${lines[lines.length - 1]}, ${chunk}`;
if (indent + merged.length <= max) {
lines[lines.length - 1] = merged;
return lines;
}