Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const atomise = (css, result, mapPath, mapHandler) => {
reportStats(result, stats(css.toString()), 'magenta', 'Found: ');
// We'll create a new root of atomic classes to eventually return in the result
const newRoot = [];
// We also need a place to store the map of original classnames to the atomic ones
const atomicMap = {};
// Prepare the CSS for parsing:
// 1. get single instances of each selector if its a list
unchainSelectors(css); // .a, .b {} => .a {}; .b {}
// 2. merge rules with the same selector if they have the same container (root, at-rule etc)
mergeRulesBySelector(css); // .a {}; .a {} => .a {}
// 3. expand shorthand rules