diff --git a/src/lib/addCustomMediaQueries.js b/src/lib/addCustomMediaQueries.js index 69d4fe5d9..5700c6dd5 100644 --- a/src/lib/addCustomMediaQueries.js +++ b/src/lib/addCustomMediaQueries.js @@ -1,6 +1,23 @@ import _ from 'lodash' import postcss from 'postcss' +function buildMediaQuery(breakpoint) { + if (_.isString(breakpoint)) { + breakpoint = {min: breakpoint} + } + return _(breakpoint).map((value, feature) => { + feature = _.get( + { + min: 'min-width', + max: 'max-width', + }, + feature, + feature + ) + return `(${feature}: ${value})` + }).join(' and ') +} + export default function(options) { let breakpoints = options.breakpoints @@ -16,23 +33,3 @@ export default function(options) { }) } } - -function buildMediaQuery(breakpoint) { - if (_.isString(breakpoint)) { - breakpoint = {min: breakpoint} - } - return _(breakpoint) - .toPairs() - .map(([feature, value]) => { - feature = _.get( - { - min: 'min-width', - max: 'max-width', - }, - feature, - feature - ) - return `(${feature}: ${value})` - }) - .join(' and ') -}