Live data from Hacker News

CSS Grid – Table layout is back. Be there and be square

developers.google.com

171–180 of 280 posts

Re: CSS Grid – Table layout is back. Be there and be square

#171

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

Could you give an example of how such a Lisp-like syntax would look, to show the improvement?

Re: CSS Grid – Table layout is back. Be there and be square

#172
post #72

This doesn't really fix much - if the idea is to continue to use pixel-based positioning. I've got devices with a range of dot-pitches (surface 4 pro, external older monitor, cellphone) - with various physical screen sizes -- A "150px sidebar" doesn't work the same across these devices - and more importantly, for a low-resolution 24" screen I'd probably want a similar 3" side-bar as for a "retina"-resolution 24" scre…

There is no requirement that the units be pixel-based. You can and should still use em/rem/vh/vw/vmin/vmax depending on your needs, along with media queries.

Re: CSS Grid – Table layout is back. Be there and be square

#173

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

The syntax is pretty simple. The problem is all the available attributes and values. I don't see how lisp syntax would help.

Re: CSS Grid – Table layout is back. Be there and be square

#174

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

[deleted]

Re: CSS Grid – Table layout is back. Be there and be square

#175
post #25

Both Android (ConstraintLayout) and iOS (Auto Layout) use Cassowary. Why not just implement this with CSS as well so we can use the same layout tech for every platform?

Athor here :)

I totally feel you, and that is what Houdini’s Custom Layout is going to be about: https://github.com/w3c/css-houdini-drafts/blob/2b730220b2f3c...

I want to write a blog post about constraing based layouts on the web specifically, but the TL;DR on why we don’t have it already:

Standardization is hard. It’s especially hard to reach consensus when:

* the runtime for a layout algorithm is hard to estimate

* it can _fail_ (which is unprecedented in CSS)

* a new syntax for constrains would have to be defined.

Re: CSS Grid – Table layout is back. Be there and be square

#176

I don't know how to say it politely but what has been achieved by using ad-hoc syntax such as this gem (and similar complex CSS syntax): display: grid; grid-template-rows: 150px [nav-start] auto 100px [nav-end]; grid-template-columns: [header-start] minmax(200px, 3fr) 9fr [header-end]; CSS fans for some reason seem to think that its somehow better to have rendering/presentational properties in an ad-hoc language. Ori…

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

Yes, if there a model of how to make something so easy and intutitive that anyone can pick it up and be productive, it is definitely Lisp.

Re: CSS Grid – Table layout is back. Be there and be square

#178
post #173

Earlier quoted context omitted.

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

The syntax is pretty simple. The problem is all the available attributes and values. I don't see how lisp syntax would help.

I guess you could then just plop in a small lisp (scheme!) function instead of units and values in order to place things as you like them.

You could then have standard functions that did what a lot of the keywords did.

On the other hand, It could get incredibly complicated too...

Re: CSS Grid – Table layout is back. Be there and be square

#179

Earlier quoted context omitted.

> I feel like it all started to go downhill, fast, with the background gradient syntax I'll take background in CSS over tiled 1px-wide gradient background images any day . The responsibilities being piled to CSS keep increasing, but I believe it is being done in good faith to at improve/formalize what people in the wild are already doing with hacks. Remember DHTML?

Oh I do, I do... and I agree that many of the things CSS does for you today are vastly better than the ad-hoc solutions we had in the past (if you ever have to create an HTML email - and thankfully I am able to outsource all of that sort of work to someone who actually takes a perverse pleasure in it - that's always a nice reminder of how silly HTML and CSS were in the late '90s before CSS was actually broadly usable…

> But still... some of the syntax we have now, not to mention the sheer breadth of verbiage, is insane

I had somehow missed that your gripe is with the syntax - I fully agree with you on that! CSS definitely feels kludgey, especially for larger/complex apps or sites. I now think of real CSS as a target that my build system generates as I mostly write in Sass or LESS. I find those superior to vanilla CSS in maintainability and composability.

Re: CSS Grid – Table layout is back. Be there and be square

#180

Earlier quoted context omitted.

CSS would have been so simple if it had just adopted a plain LISP syntax. It is so difficult to memorise all the special and inconsistent syntax for every new thingamajig that browser vendors choose to introduce. Need to painfully look up a CSS reference if you haven't used that special rule in more than a week as it just doesn't seem to get retained (at-least for me) into long term memory.

Yes, if there a model of how to make something so easy and intutitive that anyone can pick it up and be productive, it is definitely Lisp.

Ha ha, but is it more confusing than javascript actually - removing the factor that what you already know is less complex than a new thing.

(Especially scheme is rather rigid in my humble opinion.)

Post reply on HN