You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
659 B

2 years ago
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "default", {
  6. enumerable: true,
  7. get: ()=>buildMediaQuery
  8. });
  9. function buildMediaQuery(screens) {
  10. screens = Array.isArray(screens) ? screens : [
  11. screens
  12. ];
  13. return screens.map((screen)=>screen.values.map((screen)=>{
  14. if (screen.raw !== undefined) {
  15. return screen.raw;
  16. }
  17. return [
  18. screen.min && `(min-width: ${screen.min})`,
  19. screen.max && `(max-width: ${screen.max})`,
  20. ].filter(Boolean).join(" and ");
  21. })).join(", ");
  22. }