Closed ryanve closed 12 years ago
Ok so after thinking about this for a bit I decided to use a new method name wave
for the vertical tests rather than having sub objects. It's way easier to type and it's easy to understand if you imagine a big wave at the beach (we gotta have some fun too ;). So here's what we have:
Response.band(min, max)
tests viewport width
ranges. @since 0.1.1
Response.wave(min, max)
tests viewport height
ranges. @since 0.2.9
Response.device.band(min, max)
tests device-width
ranges. @since 0.2.9
Response.device.wave(min, max)
tests device-height
ranges. @since 0.2.9
Response.dpr(min, max)
tests device-pixel-ratio
ranges. @since 0.2.0
In the upcoming version 0.2.9 I'm considering introducing some new methods. Currently we have
Response.band(min, max)
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, keeps them in line with existing methods, and keeps them as concise as possible.Proposed new methods
Response.band.vertical(min, max)
as a height-based version ofResponse.band
Response.device.band(min, max)
as a device-width based version ofResponse.band
Response.device.band.vertical(min, max)
as a device-height based version ofResponse.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()
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 ofResponse.band
Response.device.band(min, max)
as a device-width based version ofResponse.band
Response.device.band.v(min, max)
as a device-height based version ofResponse.band
So what's better?
.vertical
(longer, more semantic) OR.v
(shorter, less semantic) OR something different entirely?