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

Skip to content

Commit ee5b601

Browse files
authored
Updated SASS code snippet in README.md
I updated the SASS code snippet in README.md to more directly reference the gridstack item, and avoid problems where the widths of the gridstack items, are still set by gridstack.css and not this code. See issue gridstack#868 (gridstack#868) for an example.
1 parent d6590d6 commit ee5b601

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,18 +216,18 @@ For 4-column grid it should be:
216216

217217
and so on.
218218

219-
Here is a SASS code snipped which can make life easier (Thanks to @ascendantofrain, [#81](https://github.com/gridstack/gridstack.js/issues/81)):
219+
Here is a SASS code snippet which can make life easier (Thanks to @ascendantofrain, [#81](https://github.com/gridstack/gridstack.js/issues/81) and @StefanM98, [#868](https://github.com/gridstack/gridstack.js/issues/868)):
220220

221221
```sass
222-
.grid-stack-item {
222+
.grid-stack > .grid-stack-item {
223223
224224
$gridstack-columns: 12;
225225
226226
@for $i from 1 through $gridstack-columns {
227227
&[data-gs-width='#{$i}'] { width: (100% / $gridstack-columns) * $i; }
228228
&[data-gs-x='#{$i}'] { left: (100% / $gridstack-columns) * $i; }
229-
&.grid-stack-item[data-gs-min-width='#{$i}'] { min-width: (100% / $gridstack-columns) * $i; }
230-
&.grid-stack-item[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; }
229+
&.grid-stack > .grid-stack-item[data-gs-min-width='#{$i}'] { min-width: (100% / $gridstack-columns) * $i; }
230+
&.grid-stack > .grid-stack-item[data-gs-max-width='#{$i}'] { max-width: (100% / $gridstack-columns) * $i; }
231231
}
232232
}
233233
```

0 commit comments

Comments
 (0)