index.js
function(breakpoints, spacingScale) {
    return _.map(breakpoints, function(breakpointValue, breakpointKey) {
        let mediaQuery = postcss.atRule({
            name: 'media',
            params: breakpointValue,
        })

        let rules = _.flatMap(spacingScale, function(scaleValue, scaleKey) {
            return _.map(helpers, function(helperValues, helperKey) {
                return makeFunctionalRule(
                    `.${breakpointKey}-${helperKey}${scaleKey}`,
                    helperValues,
                    scaleValue
                )
            })
        })

        return mediaQuery.append(rules)
    })
}
function(breakpoints, spacingScale) {
    return _.map(breakpoints, function(breakpointValue, breakpointKey) {
        let mediaQuery = postcss.atRule({
            name: 'media',
            params: breakpointValue,
        })

        let rules = _.flatMap(spacingScale, function(scaleValue, scaleKey) {
            return _.map(helpers, function(helperValues, helperKey) {
                return makeFunctionalRule(
                    `.${breakpointKey}-${helperKey}${scaleKey}`,
                    helperValues,
                    scaleValue
                )
            })
        })

        return mediaQuery.append(rules)
    })
}
function ( breakpoints , spacingScale ) { return _ . map ( breakpoints , function ( breakpointValue , breakpointKey ) { let mediaQuery = postcss . atRule ( { name : 'media' , params : breakpointValue , } ) let rules = _ . flatMap ( spacingScale , function ( scaleValue , scaleKey ) { return _ . map ( helpers , function ( helperValues , helperKey ) { return makeFunctionalRule ( ` ${ breakpointKey } ${ helperKey } ${ scaleKey } ` , helperValues , scaleValue ) } ) } ) return mediaQuery . append ( rules ) } ) }
Generate a complete set of responsive spacing helpers
@param  {object} breakpoints A set of breakpoints to generate the spacer for
@param  {object} spacingScale The spacing scale to use
@return {array}             Rules
Generate a complete set of responsive spacing helpers