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

babel-plugin-em-media-query

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-em-media-query

Babel plugin for transforming min/max-width/height media queries to ems.

  • 1.2.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
6
decreased by-40%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-em-media-query

Build Status

Babel plugin for transforming min/max-width/height media queries to ems.

Install

npm install babel-plugin-em-media-query --save

Usage

Use it via available plugin activation options.

For .babelrc file:

{
	"plugins": [
		"babel-plugin-em-media-query"
	]
}

Then, in your code:

/* Before */

// Standard matchMedia call
window.matchMedia('screen and (min-width:600px) and (max-width:739px)');

// Special leading comment before string or template literal
const jackie = /* @media */ 'screen and (min-width:600px)';

/* After */

window.matchMedia('screen and (min-width:37.5em) and (max-width:46.1875em)');

const jackie = 'screen and (min-width:37.5em)';

Options

precision

Type: Integer
Default: 5

Rounding precision for values.

License

MIT © Ivan Nikolić

Keywords

FAQs

Package last updated on 25 Oct 2017

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