diff options
Diffstat (limited to 'node_modules/tailwindcss/src/util/buildMediaQuery.js')
| -rw-r--r-- | node_modules/tailwindcss/src/util/buildMediaQuery.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/node_modules/tailwindcss/src/util/buildMediaQuery.js b/node_modules/tailwindcss/src/util/buildMediaQuery.js new file mode 100644 index 0000000..8489dd4 --- /dev/null +++ b/node_modules/tailwindcss/src/util/buildMediaQuery.js @@ -0,0 +1,22 @@ +export default function buildMediaQuery(screens) { + screens = Array.isArray(screens) ? screens : [screens] + + return screens + .map((screen) => { + let values = screen.values.map((screen) => { + if (screen.raw !== undefined) { + return screen.raw + } + + return [ + screen.min && `(min-width: ${screen.min})`, + screen.max && `(max-width: ${screen.max})`, + ] + .filter(Boolean) + .join(' and ') + }) + + return screen.not ? `not all and ${values}` : values + }) + .join(', ') +} |