News for hackers. Stuff that matters.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by goblin89 on Friday September 04, 2015 @10:19AM (#10170582)
Anyone interested in grid layouts on the web should probably take a look at the native CSS Grid Layout feature[0]. Unlike existing solutions it doesn’t require rigid HTML structure or extensive class usage of questionable semanticity.

It might not be too practical if you’re building something here and now, given that spec drafts are subject to change. On the other hand, there are polyfills already and full browser support seems to be on its way.

[0] A nice overview I stumbled across recently: https://medium.com/@patrickbrosset/css-grid-layout-6c9cba6e8...

Re:Responsive CSS grid, reordered with native HTML5 drag and... by alwillis on Saturday September 05, 2015 @03:06AM (#10174174)
Video of one the developers at a recent conference who's working on implementing the Grid spec in both WebKit and Blink: https://www.youtube.com/watch?v=9js_5MjiGFo
Re:Responsive CSS grid, reordered with native HTML5 drag and... by bbx on Friday September 04, 2015 @06:11AM (#10169571)
Each item has 16 CSS classes (!) attached to it: 2 for the position, 2 for the dimensions, times 4 for each breakpoint.

It sounds unusable to keep track of all these classes (even with preprocessors) but the drag'n'drop feature changes everything, and makes this an excellent tool to create a landing page builder.

Re:Responsive CSS grid, reordered with native HTML5 drag and... by seer on Friday September 04, 2015 @06:20AM (#10169595)
As this was created mainly for a "landing page builder" tool, the assumption was that classes are added dynamically with a scripting language so its not that big of a problem. I did think quite a bit on how to minimize the clutter and I either had to do a colossal CSS file with all the permutations or a smaller css and a bit more text in the html. Sadly I am not aware of a way how make both of them reasonably small (few css rules and few css classes in the html) - if anybody has an Idea I would be very grateful.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by bbx on Friday September 04, 2015 @06:34AM (#10169624)
Yeah that was my thought process: "Wow there's a lot of CSS classes. But the drag'n'drop builder makes this number irrelevant."

I'm actually working on updating a landing page builder today, so the timing is perfect. I don't think you can reduce the number of classes in the HTML but that's fine. Maybe have a Sass mixing to generate the CSS cases.

In the end, the size of both the HTML and CSS are negligible considering everything is auto generated.

Great tool. I love it!

Re:Responsive CSS grid, reordered with native HTML5 drag and... by cburgmer on Friday September 04, 2015 @06:41AM (#10169642)
<rant>Yet another grid implementation that requires jQuery.</rant>

My last search on responsive grids (June 2015) has not turned up anything without jQuery. That would be a cool new "feature", that none of the existing solutions so far offer.

Re:Responsive CSS grid, reordered with native HTML5 drag and... by seer on Friday September 04, 2015 @06:52AM (#10169669)
Yeah I was thinking about removing the jQuery dependancy, as I don't "really" need it here - all of the heavy logic is implemented outside of jQuery and I used it mostly for easy event delegation and data attribute handling. I might work on a version without it, but I wanted to get this working as soon as possible and jQuery does help in code size reduction and ease of development. Also this grid works without any javascript (pure css) so you only need javascript for drag'n'drop reordering
Re:Responsive CSS grid, reordered with native HTML5 drag and... by lukeholder on Friday September 04, 2015 @10:14AM (#10170544)
Would love to see a version without jQuery! Thanks for the great work.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by matthewmacleod on Friday September 04, 2015 @06:50AM (#10169665)
That would be a cool new "feature"

Why? jQuery is a popular, useful library. It makes lots of things simpler, and in most cases isn't an additional dependency.

Re:Responsive CSS grid, reordered with native HTML5 drag and... by serverholic on Friday September 04, 2015 @10:14AM (#10170543)
jQuery is a bloated library that tries to do too much. It's slow and becoming less and less necessary as browsers become more standards compliant.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by balls187 on Friday September 04, 2015 @11:53AM (#10171225)
Can you link to articles on jQuery's performance issues?

Is it's implementation slow, or do you mean it's size makes over the wire transmission slow?

Are all jQuery methods slow, or specific cases like DOM manipulation and/or AJAX calls.

It seems that a few years back jQuery had these issues, but are those claims still relevant?

Re:Responsive CSS grid, reordered with native HTML5 drag and... by mtschopp on Friday September 04, 2015 @12:47PM (#10171533)
It's because jQuery is a library on top of JavaScript. That makes it slower than native JavaScript.

If you don't need to support very old browsers you can easy go without jQuery.

Have a look at http://youmightnotneedjquery.com

Re:Responsive CSS grid, reordered with native HTML5 drag and... by alwillis on Saturday September 05, 2015 @03:02AM (#10174169)
Re:Responsive CSS grid, reordered with native HTML5 drag and... by Gigablah on Friday September 04, 2015 @09:45AM (#10170318)
If you use React, there's react-grid-layout: https://strml.github.io/react-grid-layout/examples/0-showcas...
Re:Responsive CSS grid, reordered with native HTML5 drag and... by ssclafani on Friday September 04, 2015 @12:39PM (#10171494)
Re:Responsive CSS grid, reordered with native HTML5 drag and... by err4nt on Saturday September 05, 2015 @07:43AM (#10174555)
No jQuery! http://codepen.io/tomhodgins/pen/vOqaVa

if you want grids its easy enough to just build exactly what you want, trying to use grid systems is harder than building them.

Re:Responsive CSS grid, reordered with native HTML5 drag and... by emodendroket on Friday September 04, 2015 @09:27AM (#10170216)
It'd probably be preferable to have jQuery and various libraries that depend on it to having different, slightly different variations on things jQuery does from each library you include.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by at-fates-hands on Friday September 04, 2015 @11:44AM (#10171172)
Have you tried Jeet yet? It usually doesn't come up in the Google searches for grids.

http://jeet.gs/

Re:Responsive CSS grid, reordered with native HTML5 drag and... by pygy_ on Friday September 04, 2015 @12:01PM (#10171267)
I really love the minimal yet very powerful approach taken by PocketGrid.

Http://arnaudleray.github.io/pocketgrid/

Re:Responsive CSS grid, reordered with native HTML5 drag and... by blahyawnblah on Friday September 04, 2015 @12:37PM (#10171488)
Re:Responsive CSS grid, reordered with native HTML5 drag and... by victorantos on Friday September 04, 2015 @11:42AM (#10171161)
The company behind this project is Clippings Ltd http://compck.com/#!/company/08356423
Re:Responsive CSS grid, reordered with native HTML5 drag and... by bildung on Friday September 04, 2015 @07:16AM (#10169735)
Looks nice! But I think I found a bug: In the static html demo with a small window (xs), the cells 4+5 and 11+12 have no white space between each other. Chromium 43.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by seer on Friday September 04, 2015 @07:36AM (#10169776)
10x! Fixed
Re:Responsive CSS grid, reordered with native HTML5 drag and... by tacone on Friday September 04, 2015 @12:03PM (#10171274)
Very nice. Tip: dragging 1 over 3 does switch them, as I would expect. 3 over 1 works though.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by 0x4a42 on Friday September 04, 2015 @09:13AM (#10170151)
Under which browsers/engine should it be used? I'm asking because I'm using Firefox 42 and I'm getting a lot of glitchs with the gutters' sizes.
Re:Responsive CSS grid, reordered with native HTML5 drag and... by alfonsodev on Friday September 04, 2015 @07:42AM (#10169793)
I can image something like this as part of a web authoring tool based on react / web components (polymer etc..)
Re:Responsive CSS grid, reordered with native HTML5 drag and... by ctr on Friday September 04, 2015 @06:35AM (#10169627)
The download button has a typo in it: 'Downlaod Latest Release.'
Re:Responsive CSS grid, reordered with native HTML5 drag and... by WhitneyLand on Friday September 04, 2015 @02:10PM (#10171986)
Is it supposed to work on mobile?
Re:Responsive CSS grid, reordered with native HTML5 drag and... by seer on Friday September 04, 2015 @02:17PM (#10172019)
Well yes it should, though to be honest I just added the touchmove events and called it a day, it works on the few handhelds I have available for testing, but there certainly could be some issues on devices I didn't test it on. Any feedback and github issues are censiarly welcome :)
Re:Responsive CSS grid, reordered with native HTML5 drag and... by NicoJuicy on Friday September 04, 2015 @06:27AM (#10169608)
This really looks like Dashing from Shopify http://dashingdemo.herokuapp.com/sample

Which doesn't need 16 css classes :)

Re:Responsive CSS grid, reordered with native HTML5 drag and... by Gigablah on Friday September 04, 2015 @09:42AM (#10170296)
Probably worth noting that Dashing uses gridster.js: http://gridster.net/

Which also depends on jQuery.

Re:Responsive CSS grid, reordered with native HTML5 drag and... by aldanor on Friday September 04, 2015 @06:28AM (#10169610)
There's also gridstack.js