Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ca3b6c

Browse files
committed
describe how to setup non-12-column grid
1 parent 5c73400 commit 3ca3b6c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

README.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,35 @@ and HTML:
304304
<div data-bind="component: {name: 'dashboard-grid', params: $data}"></div>
305305
```
306306

307+
## Change grid width
308+
309+
To addition to `width` option, CSS rules for `.grid-stack-item[data-gs-width="X"]` and
310+
`.grid-stack-item[data-gs-x="X"]` have to be changed accordingly (see #38).
311+
312+
For 3-column grid you need to rewrite CSS to be:
313+
314+
```css
315+
.grid-stack-item[data-gs-width="3"] { width: 100% }
316+
.grid-stack-item[data-gs-width="2"] { width: 66.66666667% }
317+
.grid-stack-item[data-gs-width="1"] { width: 33.33333333% }
318+
319+
.grid-stack-item[data-gs-x="2"] { left: 66.66666667% }
320+
.grid-stack-item[data-gs-x="1"] { left: 33.33333333% }
321+
```
322+
323+
For 4-column grid it should be:
324+
325+
```css
326+
.grid-stack-item[data-gs-width="4"] { width: 100% }
327+
.grid-stack-item[data-gs-width="3"] { width: 75% }
328+
.grid-stack-item[data-gs-width="2"] { width: 50% }
329+
.grid-stack-item[data-gs-width="1"] { width: 25% }
330+
331+
.grid-stack-item[data-gs-x="3"] { left: 75% }
332+
.grid-stack-item[data-gs-x="2"] { left: 50% }
333+
.grid-stack-item[data-gs-x="1"] { left: 25% }
334+
```
335+
307336

308337
Changes
309338
=======

0 commit comments

Comments
 (0)