Helpers for building out .subsetcss.js
config files.
const { getVariables } = require('@subsetcss/config-helpers');
let colors = getVariables('app/styles/variables.scss');
// colors = [
// { key: '$primary': value: 'red' },
// { key: '$secondary': value: 'blue' }
// ]
module.exports = {
subsets: {
color: colors.map(c => c.key)
}
};
Works for files ending in .scss
and .less
.
Check out the Contributing guide.