coffee-views-pure

A coffee-views extension to add YUI's pure functionality

npm install coffee-views-pure
4 downloads in the last week
8 downloads in the last month

Pure Coffee Views

An extension to coffee-views that adds YUI's pure views.

Installation

npm i --save coffee-views-pure

The when using Coffee Views mixin the prototype:

{Base} = require 'coffee-views'
Pure = require 'coffee-views-pure'
util = require 'util'

class MyView extends Base

  render: ->
    # ...

util._extend MyView.prototype, Pure

module.exports = MyView

API

#form()

Adds the pure-form class name to the form

#stakedForm()

Adds the pure-form-stacked class name to the form

#alignedForm()

Adds the pure-form-aligned class name to the form

#grid()

Creates a grid in 2 ways.

Equal column grid

Pass an array and all the array items will be equally spaced.

@grid [
  -> @h2 'left'
  -> @h2 'right'
]

@grid [
  -> @h2 'left'
  -> @h2 'middle'
  -> @h2 'right'
]

Unequal grid

Pass an object with the keys as fractions.

@grid
  '1/3': -> @h2 'main'
  '2/3': -> @h2 'right'

#rGrid()

Same as the grid() method, but responsive.

#controlGroup()

Creates a div with the pure-control-group class.

#inputGroup()

Creates a fieldset with the pure-group class.

npm loves you