boomqueries
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -5,3 +5,3 @@ { | ||
"description": "BoomQueries is our take on element-queries; sizing elements based on their container.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "http://boomtownroi.github.io/boomqueries/", | ||
@@ -8,0 +8,0 @@ "author": { |
@@ -20,6 +20,7 @@ # BoomQueries | ||
* Install with [Bower](http://bower.io): `bower install boomqueries` | ||
* Install with [npm](http://npmjs.org): `npm install boomqueries` | ||
## Initializing/Adding Components | ||
Use `window.boomQueries.add()` to register your component(s) with the BoomQueries library. Each instanse can house a `key`; can be used to interact after it has been registered, a `selector`, and a `breaks` array, which holds references to your desired `min-width` breakpoint and the class to be added to your component. | ||
Use `window.boomQueries.add()` to register your component(s) with the BoomQueries library. Each instance can house a `key`; can be used to interact after it has been registered, a `selector`, and a `breaks` array, which holds references to your desired `min-width` breakpoint and the class to be added to your component. | ||
@@ -52,2 +53,22 @@ window.boomQueries.add("COMPONENTKEY", { | ||
## CommonJS Usage | ||
Anywhere you see window.boomQueries in our examples can be replaced with the CommonJS module version. | ||
```js | ||
var boomQueries = require('boomqueries'); | ||
boomQueries.add("COMPONENTKEY", { | ||
selector: ".component", | ||
breaks: [ | ||
[480, "component--md"], | ||
[600, "component--lg"] | ||
] | ||
}); | ||
boomQueries.remove("COMPONENTKEY"); | ||
boomQueries.calculate(); | ||
``` | ||
## Versioning | ||
@@ -60,3 +81,1 @@ | ||
Copyright 2014 [BoomTown](http://boomtownroi.com) under the [MIT License](https://github.com/boomtownroi/boomqueries/blob/LICENSE.md) | ||
6964
79