Skip to content

Commit 722dd87

Browse files
authored
Merge pull request #1193 from adumesny/develop
include SASS src files to npm pack
2 parents 04906fb + 02da5ad commit 722dd87

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

Gruntfile.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ module.exports = function(grunt) {
4848
'dist/gridstack-poly.js': ['src/gridstack-poly.js'],
4949
'dist/jquery.js': ['src/jquery.js'],
5050
'dist/jquery-ui.js': ['src/jquery-ui.js'],
51+
'dist/src/gridstack.scss': ['src/gridstack.scss'],
52+
'dist/src/gridstack-extra.scss': ['src/gridstack-extra.scss'],
5153
}
5254
}
5355
},

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,18 @@ Better yet, here is a SASS code snippet which can make life much easier (Thanks
219219
}
220220
```
221221

222-
you can also look at the SASS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/blob/develop/src/gridstack-extra.scss) and modify to add more columns
222+
you can also use the SASS [src/gridstack-extra.scss](https://github.com/gridstack/gridstack.js/blob/develop/src/gridstack-extra.scss) included in NPM package and modify to add more columns
223223
and also have the `.grid-stack-N` prefix to support letting the user change columns dynamically.
224224

225+
Sample gulp command for 30 columns:
226+
```js
227+
gulp.src('node_modules/gridstack/dist/src/gridstack-extra.scss')
228+
.pipe(replace('$gridstack-columns: 11 !default;','$gridstack-columns: 30;'))
229+
.pipe(sass({outputStyle: 'compressed'}))
230+
.pipe(rename({extname: '.min.css'}))
231+
.pipe(gulp.dest('dist/css'))
232+
```
233+
225234
## Override resizable/draggable options
226235

227236
You can override default `resizable`/`draggable` options. For instance to enable other then bottom right resizing handle

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Change log
3535
## 1.1.0-dev (upcoming)
3636

3737
- fix [1187](https://github.com/gridstack/gridstack.js/issues/1187) IE support for `CustomEvent` polyfill - thanks [@phil-blais](https://github.com/phil-blais)
38+
- include SASS source files to npm package again [1193](https://github.com/gridstack/gridstack.js/pull/1193)
3839

3940
## 1.1.0 (2020-02-29)
4041

src/gridstack-extra.scss

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
* gridstack.js may be freely distributed under the MIT license.
66
*/
77

8+
// default to generate [2-11] columns as 1 (oneColumnMode) and 12 (default) are in the main css
89
$gridstack-columns: 11 !default;
10+
$gridstack-columns-start: 2 !default;
911

1012
@mixin grid-stack-items($columns) {
1113
.grid-stack.grid-stack-#{$columns} {
@@ -23,6 +25,6 @@ $gridstack-columns: 11 !default;
2325
}
2426
}
2527

26-
@for $j from 2 through $gridstack-columns {
28+
@for $j from $gridstack-columns-start through $gridstack-columns {
2729
@include grid-stack-items($j)
2830
}

0 commit comments

Comments
 (0)