
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
ab-mediaquery
Advanced tools
AB-mediaQuery is the JavaScript side of Media Queries. It proposes you some very useful methods for your scripts
That's the JavaScript side of Media Queries. It proposes you some very useful methods for your scripts. That plugin is in vanilla JS, with no dependencies.
Demo: Codepen
NPM: https://www.npmjs.com/package/ab-mediaquery
npm install ab-mediaquery
The plugin is CommonJS and AMD compliant.
Define your breakpoints in your Sass or Less. include AB-mediaQuery.scss
or AB-mediaQuery.less
and edit breakpoints on your needs.
That must be in EM: http://zellwk.com/blog/media-query-units/. Here is a calculator if needed: http://pxtoem.com/
You then only need to call that function to create AB.mediaQuery
object and bind the breakpoint 'watcher':
mediaQuery();
In case you don't want to use Sass/Less definition, you can specify breakpoints on initialization:
mediaQuery({
small: '480em',
medium: '1024em',
large: '1280em',
huge: '1440em'
});
Return the current breakpoint. Can be 'tiny', 'small', 'medium', 'large' or 'huge':
AB.mediaQuery.current;
Check if window respects the breakpoint specified and return true/false. You can check:
AB.mediaQuery.is('smallOnly');
'changed.ab-mediaquery' event is automatically triggered when breakpoint change:
window.addEventListener('changed.ab-mediaquery', function(){
...
});
Return media query rule from breakpoint name:
AB.mediaQuery.get('small');
FAQs
AB-mediaQuery is the JavaScript side of media queries. It proposes you some very useful methods for your scripts
The npm package ab-mediaquery receives a total of 15 weekly downloads. As such, ab-mediaquery popularity was classified as not popular.
We found that ab-mediaquery demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.