babel-plugin-media-query-gap
Babel plugin for applying gap on max-width/height media queries.
Useful when you want to prevent double breakpoints.
Install
npm install babel-plugin-media-query-gap --save
Usage
Use it via available plugin activation options.
For .babelrc
file:
Then, in your code:
/* Before */ // Standard matchMedia callwindow; // Special leading comment before string or template literalconst jackie = /* @media */ 'screen and (max-width:600px)'; /* After */ window; const jackie = /* @media */ 'screen and (max-width:599px)';
License
MIT © Ivan Nikolić