New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

media-engine

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

media-engine

Media query calculator

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
558K
decreased by-20.65%
Maintainers
1
Weekly downloads
 
Created
Source

media-engine

Media queries engine written in pure JS!

npm Travis license

Install

npm install media-engine --save
# or
yarn add media-engine

API

min-height

matchMedia(
  {
    '@media min-height: 700': {
      color: 'green',
    },
  },
  { height: 800 }
);
// { color: 'green' }

matchMedia(
  {
    '@media min-height: 700': {
      color: 'green',
    },
  },
  { height: 100 }
);
// { }

max-height

matchMedia(
  {
    '@media max-height: 700': {
      color: 'green',
    },
  },
  { height: 100 }
);
// { color: 'green' }

matchMedia(
  {
    '@media max-height: 700': {
      color: 'green',
    },
  },
  { height: 800 }
);
// { }

min-width

matchMedia(
  {
    '@media min-width: 700': {
      color: 'green',
    },
  },
  { width: 800 }
);
// { color: 'green' }

matchMedia(
  {
    '@media min-width: 700': {
      color: 'green',
    },
  },
  { width: 100 }
);
// { }

max-width

matchMedia(
  {
    '@media max-width: 700': {
      color: 'green',
    },
  },
  { width: 100 }
);
// { color: 'green' }

matchMedia(
  {
    '@media max-width: 700': {
      color: 'green',
    },
  },
  { width: 800 }
);
// { }

orientation

matchMedia(
  {
    '@media orientation: landscape': {
      color: 'green',
    },
  },
  { orientation: 'landscape' }
);
// { color: 'green' }

matchMedia(
  {
    '@media orientation: landscape': {
      color: 'green',
    },
  },
  { orientation: 'portrait' }
);
// { }

and operator

matchMedia(
  {
    '@media (min-width: 700) and (orientation: landscape)': {
      color: 'green',
    },
  },
  { width: 800, orientation: 'landscape' }
);
// { color: 'green' }

or operator

matchMedia(
  {
    '@media (min-width: 700), (orientation: landscape)': {
      color: 'green',
    },
  },
  { orientation: 'landscape' }
);
// { color: 'green' }

multiple queries

matchMedia(
  {
    '@media orientation: landscape': {
      color: 'green',
    },
    '@media min-width: 700': {
      background: 'red',
    }
  },
  { orientation: 'landscape', width: 800 }
);
// { color: 'green', background: 'red' }

License

MIT © Diego Muracciole

FAQs

Package last updated on 08 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc