diff --git a/Gruntfile.js b/Gruntfile.js index e9ab71a3..e5efd75e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,7 +21,6 @@ module.exports = function(grunt) { dist: { files: { 'dist/gridstack.css': 'src/gridstack.scss', - 'dist/gridstack-extra.css': 'src/gridstack-extra.scss' } } }, @@ -33,7 +32,6 @@ module.exports = function(grunt) { }, files: { 'dist/gridstack.min.css': ['dist/gridstack.css'], - 'dist/gridstack-extra.min.css': ['dist/gridstack-extra.css'] } } }, @@ -42,7 +40,6 @@ module.exports = function(grunt) { files: { 'dist/es5/gridstack-poly.js': ['src/gridstack-poly.js'], 'dist/src/gridstack.scss': ['src/gridstack.scss'], - 'dist/src/gridstack-extra.scss': ['src/gridstack-extra.scss'], 'dist/angular/README.md': ['angular/README.md'], 'dist/angular/src/gridstack.component.ts': ['angular/projects/lib/src/lib/gridstack.component.ts'], 'dist/angular/src/gridstack-item.component.ts': ['angular/projects/lib/src/lib/gridstack-item.component.ts'], diff --git a/README.md b/README.md index 315a825c..326bec10 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids - [Extend Library](#extend-library) - [Extend Engine](#extend-engine) - [Change grid columns](#change-grid-columns) - - [Custom columns CSS](#custom-columns-css) + - [Custom columns CSS (OLD, not needed with v12+)](#custom-columns-css-old-not-needed-with-v12) - [Override resizable/draggable options](#override-resizabledraggable-options) - [Touch devices support](#touch-devices-support) - [Migrating](#migrating) @@ -48,6 +48,7 @@ Join us on Slack: [https://gridstackjs.slack.com](https://join.slack.com/t/grids - [Migrating to v9](#migrating-to-v9) - [Migrating to v10](#migrating-to-v10) - [Migrating to v11](#migrating-to-v11) + - [Migrating to v12](#migrating-to-v12) - [jQuery Application](#jquery-application) - [Changes](#changes) - [Usage Trend](#usage-trend) @@ -207,6 +208,8 @@ GridStack makes it very easy if you need [1-12] columns out of the box (default GridStack.init( {column: N} ); ``` +NOTE: step 2 is OLD and not needed with v12+ which uses CSS variables instead of classes + 2) also include `gridstack-extra.css` if **N < 12** (else custom CSS - see next). Without these, things will not render/work correctly. ```html @@ -219,7 +222,9 @@ Note: class `.grid-stack-N` will automatically be added and we include `gridstac See example: [2 grids demo](http://gridstack.github.io/gridstack.js/demo/two.html) with 6 columns -## Custom columns CSS +## Custom columns CSS (OLD, not needed with v12+) + +NOTE: step is OLD and not needed with v12+ which uses CSS variables instead of classes 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"]`. @@ -491,6 +496,14 @@ GridStack.renderCB = function(el: HTMLElement, w: GridStackNode) { 4. if no `GridStackWidget` is defined, the helper will now be inserted as is, and NOT original sidepanel item. 5. support DOM gs- attr as well as gridstacknode JSON (see two.html) alternatives. +## Migrating to v12 + +* column and cell height code has been re-writen to use browser CSS variables, and we no longer need a tons of custom CSS classes! +this fixes a long standing issue where people forget to include the right CSS for non 12 columns layouts, and a big speedup in many cases (many columns, or small cellHeight values). + +**Breaking change:** +* `gridstack-extra.min.css` no longer exist, nor is custom column CSS needed. API/options hasn't changed. + # jQuery Application This is **old and no longer apply to v6+**. You'll need to use v5.1.1 and before diff --git a/angular/README.md b/angular/README.md index 58737045..2af7cd84 100644 --- a/angular/README.md +++ b/angular/README.md @@ -18,7 +18,6 @@ MyComponent CSS ```css @import "https://github.com/gridstack/dist/gridstack.min.css"; -@import "https://github.com/gridstack/dist/gridstack-extra.min.css"; // if you use 2-11 column .grid-stack { background: #fafad2; diff --git a/angular/angular.json b/angular/angular.json index c7961035..ad2ef721 100644 --- a/angular/angular.json +++ b/angular/angular.json @@ -55,7 +55,6 @@ ], "styles": [ "node_modules/gridstack/dist/gridstack.min.css", - "node_modules/gridstack/dist/gridstack-extra.min.css", "projects/demo/src/styles.css" ], "scripts": [] @@ -121,7 +120,6 @@ ], "styles": [ "node_modules/gridstack/dist/gridstack.min.css", - "node_modules/gridstack/dist/gridstack-extra.min.css", "projects/demo/src/styles.css" ], "scripts": [] diff --git a/angular/projects/demo/src/app/app.component.ts b/angular/projects/demo/src/app/app.component.ts index c827d627..4874f9b9 100644 --- a/angular/projects/demo/src/app/app.component.ts +++ b/angular/projects/demo/src/app/app.component.ts @@ -56,7 +56,7 @@ export class AppComponent implements OnInit { // nested grid options private subOptions: GridStackOptions = { cellHeight: 50, // should be 50 - top/bottom - column: 'auto', // size to match container. make sure to include gridstack-extra.min.css + column: 'auto', // size to match container acceptWidgets: true, // will accept .grid-stack-item by default margin: 5, }; diff --git a/demo/column.html b/demo/column.html index bed7fc05..61433ba6 100644 --- a/demo/column.html +++ b/demo/column.html @@ -7,7 +7,6 @@