Skip to content

Commit cb94bcd

Browse files
committed
documentation: fixed styling example for adding grid lines
1 parent 880a11b commit cb94bcd

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

website/docs/.vuepress/components/ExampleStylingGridLines.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,20 @@ export default {
9090
9191
.grid::before {
9292
content: '';
93-
background-size: calc(calc(100% - 10px) / 12) 40px;
94-
margin: 6px;
93+
background-size: calc(calc(100% - 5px) / 12) 40px;
9594
background-image: linear-gradient(
9695
to right,
9796
lightgrey 1px,
9897
transparent 1px
9998
),
10099
linear-gradient(to bottom, lightgrey 1px, transparent 1px);
101-
height: 100%;
102-
width: 100%;
100+
height: calc(100% - 5px);
101+
width: calc(100% - 5px);
102+
/*height: 100%;*/
103+
/*width: 100%;*/
103104
position: absolute;
104105
background-repeat: repeat;
106+
margin:5px;
105107
}
106108
107109
.vue-grid-layout {

website/docs/guide/styling.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,24 +52,26 @@ To add grid lines to the layout, add the ``grid`` class to the grid-layout eleme
5252
````css
5353
.grid::before {
5454
content: '';
55-
background-size: calc(calc(100% - 12px) / 12) 112px;
55+
background-size: calc(calc(100% - 5px) / 12) 40px;
5656
background-image: linear-gradient(
5757
to right,
5858
lightgrey 1px,
5959
transparent 1px
6060
),
6161
linear-gradient(to bottom, lightgrey 1px, transparent 1px);
62-
height: 100%;
63-
width: 100%;
62+
height: calc(100% - 5px);
63+
width: calc(100% - 5px);
6464
position: absolute;
6565
background-repeat: repeat;
66-
margin: 6px;
66+
margin:5px;
6767
}
6868
````
6969

7070
CSS calculations for grid lines:
7171

72-
* background size: calc(calc(100% - margin) / colNum) rowHeight + margin;
72+
* background size = calc(calc(100% - (margin/2)) / colNum) rowHeight + margin;
73+
* height: calc(100% - (margin/2))
74+
* width: calc(100% - (margin/2))
7375
* margin: margin / 2
7476

7577
[View source](https://github.com/jbaysolutions/vue-grid-layout/blob/master/website/docs/.vuepress/components/ExampleStylingGridLines.vue)

0 commit comments

Comments
 (0)