ryanve/response.js — Issue #2: New methods for device- and vertical-based tests
Author: ryanve
Created: 2011-12-19 12:35:03+00:00
State: open

In the upcoming version 0.2.9 I'm considering introducing some new methods. Currently we have [`Response.band(min, max)`](http://responsejs.com/#booleans) for testing whether the width of the viewport is in a min/max breakpoint range. I want to name the methods in a way that makes them easy to understand but also as concise as possible.

### Proposed new methods
- `Response.band.vertical(min, max)` as a height-based version of `Response.band`
- `Response.device.band(min, max)` as a device-width based version of `Response.band`
- `Response.device.band.vertical(min, max)` as a device-height based version of `Response.band`

They'd add very little overhead so, and seem like worthwhile additions, right? As for the names, I think the use of `.height` should be avoided as to avoid confusing it with the native property or with jQuery's [`.height()`](http://api.jquery.com/height/) method. `.vertical` and `.device` both seem pretty understandable (right?) but it also starts to get a bit long. It'd save some bytes if we just use `.v` as shown below.

### Naming scheme 2
- `Response.band.v(min, max)` as a height-based version of `Response.band`
- `Response.device.band(min, max)` as a device-width based version of `Response.band`
- `Response.device.band.v(min, max)` as a device-height based version of `Response.band`

So what's better? `.vertical` (longer, more semantic) OR `.v` (shorter, less semantic) OR something different entirely?