Skip to content

Commit 7e0a000

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents a421ff3 + 00625e3 commit 7e0a000

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

README.md

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
[![npm version](https://img.shields.io/npm/v/react-inline-grid.svg?style=flat-square)](https://www.npmjs.com/package/react-inline-grid)
1616

1717
## Install
18-
`npm install --save react-inline-grid`
18+
`npm install react-inline-grid --save`
1919

2020
## API
2121

@@ -48,19 +48,18 @@ ReactDOM.render(<Layout />, document.body);
4848
The library exports `Grid`, `Row` and `Cell`.
4949

5050
### &lt;Grid />
51-
Wrap child component with [Redux](https://github.com/rackt/redux) `Provider` and exposes the props `options` (array) to define custom grid settings.
51+
Wrap child component with [React Redux](https://github.com/rackt/react-redux#provider-store) `<Provider>`, update store according to device properties update using [media queries](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries) and exposes the props `options` (array) allowing you to define custom grid settings.
5252

5353
`options` shape:
5454

5555
```js
5656
[
5757
{
5858
name: string // required - Name of the target screen, used as key word ex: <name>-12.
59-
order: number // required - From smaller to bigger screen.
60-
query: string // required - Media query to test.
6159
gutter: number // default = 0 - Gutter size in pixel.
6260
margin: number // default = 0 - Margin size in pixel.
6361
columns: number // default = 12 - Total number of columns for each row.
62+
query: string // required - Media query to test.
6463
}
6564
]
6665
```
@@ -74,28 +73,28 @@ If `options` is not provided, a default configuration inspired by [Google MDL](h
7473
gutter: 16,
7574
margin: 16,
7675
columns: 4,
77-
order: 0,
7876
query: '(max-width: 479px)'
7977
},
8078
{
8179
name: 'tablet',
8280
gutter: 16,
8381
margin: 16,
8482
columns: 8,
85-
order: 1,
8683
query: '(min-width: 480px) and (max-width: 839px)'
8784
},
8885
{
8986
name: 'desktop',
9087
gutter: 16,
9188
margin: 16,
9289
columns: 12,
93-
order: 2,
9490
query: '(min-width: 840px)'
9591
}
9692
]
9793
```
9894

95+
Also, as the style properties are generated from `options` using the ["bigger" device as reference](https://github.com/broucz/react-inline-grid/blob/master/src/utils/hydrateReference.js#L12), target devices order in `options` matters.
96+
I want to avoid to test queries at loading time or add extra fields in `options` so far, and so I choose the "popular" mobile first approch. **The "bigger" targeted device have to be the last entry of `options`**.
97+
9998
### &lt;Row />
10099

101100
Exposes the props `is` (string) to alterate the following default style object:
@@ -146,9 +145,6 @@ Exposes the props `is` (string) to alterate the following default style object:
146145
</Cell>
147146
</Row>
148147
```
149-
## Context
150-
151-
TODO when really used.
152148

153149
## Examples
154150

0 commit comments

Comments
 (0)