Skip to content

Commit 09fbacb

Browse files
committed
fixed scss readme for sassmeister.com
1 parent 021a7db commit 09fbacb

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.htm
219219

220220
If you need > 12 columns or want to generate the CSS manually you will need to generate CSS rules for `.grid-stack-item[gs-w="X"]` and `.grid-stack-item[gs-x="X"]`.
221221

222-
For instance for 4-column grid you need to write CSS to be:
222+
For instance for 4-column grid you need CSS to be:
223223

224224
```css
225225
.gs-4 > .grid-stack-item[gs-x="1"] { left: 25% }
@@ -232,29 +232,30 @@ For instance for 4-column grid you need to write CSS to be:
232232
.gs-4 > .grid-stack-item[gs-w="4"] { width: 100% }
233233
```
234234

235-
Better yet, here is a SASS code snippet, you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead:
235+
Better yet, here is a SCSS code snippet, you can use sites like [sassmeister.com](https://www.sassmeister.com/) to generate the CSS for you instead:
236236

237-
```sass
237+
```scss
238238
$columns: 20;
239239
@function fixed($float) {
240-
@return calc(round($float * 100) / 100); // total 4 digits being %
240+
@return round($float * 100) / 100; // total 4 digits being %
241241
}
242242
.gs-#{$columns} > .grid-stack-item {
243243

244-
width: fixed(calc(100% / $columns));
244+
width: fixed(100% / $columns);
245245

246246
@for $i from 1 through $columns - 1 {
247-
&[gs-x='#{$i}'] { left: fixed(calc(100% / $columns) * $i); }
248-
&[gs-w='#{$i+1}'] { width: fixed(calc(100% / $columns) * ($i+1)); }
247+
&[gs-x='#{$i}'] { left: fixed((100% / $columns) * $i); }
248+
&[gs-w='#{$i+1}'] { width: fixed((100% / $columns) * ($i+1)); }
249249
}
250250
}
251251
```
252252

253-
you can also use the SASS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/tree/master/src/gridstack-extra.scss) included in NPM package and modify to add more columns.
253+
you can also use the SCSS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/tree/master/src/gridstack-extra.scss) included in NPM package and modify to add more columns.
254254

255255
Sample gulp command for 30 columns:
256256
```js
257257
gulp.src('node_modules/gridstack/dist/src/gridstack-extra.scss')
258+
.pipe(replace('$gridstack-columns-start: 2 !default;','$gridstack-columns-start: 30;'))
258259
.pipe(replace('$gridstack-columns: 11 !default;','$gridstack-columns: 30;'))
259260
.pipe(sass({outputStyle: 'compressed'}))
260261
.pipe(rename({extname: '.min.css'}))

0 commit comments

Comments
 (0)