lml-main
Version:
This is now a mono repository published into many standalone packages.
13 lines (11 loc) • 405 B
JavaScript
// tooling
const comma = require('postcss').list.comma;
// merge selectors
module.exports = (fromSelectors, toSelectors) => (typeof fromSelectors === 'string' ? comma(fromSelectors) : fromSelectors).reduce(
(selectors, fromSelector) => selectors.concat(
(typeof toSelectors === 'string' ? comma(toSelectors) : toSelectors).map(
(toSelector) => toSelector.replace(/&/g, fromSelector)
)
),
[]
);