mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Refactor toPairs to object map; move private function to top
This commit is contained in:
parent
6bbbe47e9b
commit
8eb25475b4
@ -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 ')
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user