* remove `lodash` usage * implement custom cloneDeep to replace lodash's * drop lodash in processPlugins * add `toPath` utility * add `tap` utility * add `cloneDeep` utility * drop lodash in evaluateTailwindFunctions * add `defaults` utility * drop lodash from `resolveConfig` * remove `lodash` dependency
24 lines
559 B
JavaScript
24 lines
559 B
JavaScript
export default function buildMediaQuery(screens) {
|
|
if (typeof screens === 'string') {
|
|
screens = { min: screens }
|
|
}
|
|
|
|
if (!Array.isArray(screens)) {
|
|
screens = [screens]
|
|
}
|
|
|
|
return screens
|
|
.map((screen) => {
|
|
if (screen?.hasOwnProperty?.('raw')) {
|
|
return screen.raw
|
|
}
|
|
|
|
return Object.entries(screen)
|
|
.map(([feature, value]) => {
|
|
feature = { min: 'min-width', max: 'max-width' }[feature] ?? feature
|
|
return `(${feature}: ${value})`
|
|
})
|
|
.join(' and ')
|
|
})
|
|
.join(', ')
|
|
}
|