dragon-grid
v1.3.0
Published
Insanely powerful grid in just a few lines of code.
Downloads
4
Maintainers
Readme
Insanely powerful grid in just a few lines of code. 10 minutes to master.
Features
- Responsive grid
- Consistently sized fixed gutters
- Infinite nesting with ease
- On the fly grids in the form of fractions (e.g.
column(1/2)
would take up 1/2 the size of it's container)
CodePens
Installation
Just import this mixin anywhere in your project for quick use.
- Stylus CLI
npm i -g dragon-grid
- Add
@import 'dragon'
tostyle.styl
stylus -u dragon-grid -w style.styl
- Bower
bower i dragon-grid
- Add
@import 'bower_components/dragon-grid/dragon'
tostyle.styl
stylus -w style.styl
API
Dragon runs on one mixin. This mixin requires a ratio
(a fraction) to be specified. All other arguments are optional.
column(ratio = 1, cycle = 0, uncycle = 0, gutter = 30px, offset = 0, shift = false)
ratio
- A fraction of the container's width.cycle
- Applies amargin-right: 0
to thenth
element. Useful for knocking elements to the next row automatically.uncycle
- Re-adds the gutter to the element. Useful for changingcycle
within media queries.gutter
- The size of themargin-right
applied. Since we're usingcalc()
this can be any valid unit. Pass0
togutter
in order to remove gutters.offset
- Applies amargin
to the element in a direction specified whether this value is a positive or negative fraction.shift
- Relatively positions an element according to the fractional value. Pass0
toshift
to "unshift" elements. Useful for source ordering.
Browser Support
- IE9+, Android 4.4+ http://caniuse.com/#search=calc