22
33[ ![ Build Status] ( https://secure.travis-ci.org/suitcss/components-grid.png?branch=master )] ( http://travis-ci.org/suitcss/components-grid )
44
5- A CSS grid component. The grid makes use of ` inline-block ` and ` box-sizing ` to
5+ A CSS grid component. The grid makes use of ` flexbox ` and ` box-sizing ` to
66provide features that float-based layouts cannot.
77
88N.B. This component relies on particular dimensions being applied to cells in
@@ -20,11 +20,12 @@ Read more about [SUIT CSS](https://github.com/suitcss/suit/).
2020
2121* Fluid layout.
2222* Intelligent cell wrapping.
23+ * Evenly fit cell spacing
24+ * Equal height columns
2325* Horizontal centering of cells.
2426* Custom vertical alignment of cells (top, bottom, or middle).
2527* Cell width is controlled independently of grid gutter.
2628* Infinite nesting.
27- * Built-in redundancy.
2829
2930## Available classes
3031
@@ -33,22 +34,35 @@ Read more about [SUIT CSS](https://github.com/suitcss/suit/).
3334* ` Grid--alignRight ` : right-align all child ` Grid-cell `
3435* ` Grid--alignMiddle ` : middle-align all child ` Grid-cell `
3536* ` Grid--alignBottom ` : bottom-align all child ` Grid-cell `
37+ * ` Grid--fit ` : evenly distribute space amongst all child ` Grid-cell `
38+ * ` Grid--equalHeight ` : all child ` Grid-cell ` match height of the tallest
3639* ` Grid--withGutter ` : adds a gutter between cells
3740* ` Grid-cell ` : a child cell of ` Grid ` that wraps grid content
3841* ` Grid-cell--center ` : center an individual ` Grid-cell `
3942
4043## Configurable variables
4144
42- * ` --Grid-font-size ` : the font-size to use within the Grid (defaults to 1rem).
4345* ` --Grid-gutter-size ` : the width of the gutter applied by the ` Grid--withGutter ` modifier class.
4446
4547## Use
4648
4749A simple grid is easy to create. A grid container can have any number of child
48- cells.
50+ cells. When used with ` Grid--fit ` space is evenly distributed without need for
51+ sizing utilities.
4952
5053``` html
51- <div class =" Grid [Grid--alignCenter|Grid--alignRight|Grid--alignMiddle|Grid--alignBottom]" >
54+ <div class =" Grid Grid--fit Grid--withGutter" >
55+ <div class =" Grid-cell" ></div >
56+ <div class =" Grid-cell" ></div >
57+ <div class =" Grid-cell" ></div >
58+ <div class =" Grid-cell" ></div >
59+ </div >
60+ ```
61+
62+ For more granular control over layout make use of modifiers and sizing utilities.
63+
64+ ``` html
65+ <div class =" Grid [Grid--alignCenter|Grid--alignRight|Grid--alignMiddle|Grid--alignBottom|Grid--fit|Grid--equalHeight]" >
5266 <div class =" Grid-cell u-size1of2 u-lg-size6of12" ></div >
5367 <div class =" Grid-cell u-size1of2 u-lg-size4of12" ></div >
5468 <div class =" Grid-cell u-size1of3 u-lg-size2of12" ></div >
87101```
88102
89103You can nest grids in any context, including one that uses dimension or offset
90- utilities, but keep in mind that the the dimensions will be relative to the
104+ utilities, but keep in mind that the dimensions will be relative to the
91105grid's width, and not the width of the whole application.
92106
93107``` html
@@ -114,18 +128,26 @@ To generate a build:
114128npm run build
115129```
116130
117- To generate the testing build.
131+ To generate the testing build:
118132
119133```
120134npm run build-test
121135```
122136
137+ To watch the files for making changes to test:
138+
139+ ```
140+ npm run watch
141+ ```
142+
123143Basic visual tests are in ` test/index.html ` .
124144
125145## Browser support
126146
127147* Google Chrome (latest)
128148* Opera (latest)
129- * Firefox 4+
130- * Safari 5+
131- * Internet Explorer 9+
149+ * Firefox 28+
150+ * Safari 6.1+
151+ * Internet Explorer 10+
152+
153+ Refer to the [ caniuse] ( http://caniuse.com/ ) page for [ flexbox] ( http://caniuse.com/#feat=flexbox )
0 commit comments