Skip to content
/ mqa.js Public

JavaScript library enabling use of your CSS media queries easily without duplicating code.

Notifications You must be signed in to change notification settings

peol/mqa.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mqa.js (meqa.js)

Build Status

A small (540 byte-ish, gzipped+minified!), modern library for managing media queries programmatically (i.e. in JavaScript). Most media query libraries I've seen forces the developer to duplicate their media query syntaxes (from CSS file to JavaScript file). See the documentation for more information and how to use the API.

Browser support

Every browser that supports window.matchMedia() and Array Extras should be fine. Currently tested on:

  • Firefox 19
  • Safari 6
  • Chrome 24
  • IE9 (with polyfills, see this and this*)
  • IE10
  • iOS6 (Safari & Chrome)

Develop

mqa.js uses grunt 0.4.

$ npm install -g grunt-cli
$ cd path/to/mqa.js
$ npm install
// running separate tasks:
$ grunt jshint
$ grunt test
$ grunt requirejs
// above commands are equal to running just:
$ grunt

Contributing

There's no real style-guide followed, but please follow the existing code's style. And remember to always run grunt before sending a pull request to make sure the unit tests and JSHint rules are passing.

When new features are being developed, unit tests and JSDoc documentation should be added as well. See existing tests and documentation for inspiration.

License

Dual license, MIT/GPL. Use whatever fits your project.

* = When using this polyfill, an initial event is triggered when a media query is matched when loading the document. This is not the case with native implementations and other polyfills I've tried.

About

JavaScript library enabling use of your CSS media queries easily without duplicating code.

Resources

Stars

Watchers

Forks

Packages

No packages published