Live data from Hacker News

Grid Style Sheets – Replace CSS with a Constraint-Solver

gridstylesheets.org

11–20 of 99 posts

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#11
post #9

Constraints are the right approach to layout. This should have happened years ago. The important concept here is defining layout like this: #elmA[top-left] == "area"[top-left]; #elmB[bottom-right] == "area"[top-right]; The trouble with this is that it's expressed as a programmer's approach; everything is about variables, not geometry. Constraints should be input from a GUI, like Dreamweaver. To see what this looks li…

As a non-designer, I disagree. I played around with FreeCAD a bit, and I was constantly wishing "just let me enter the damn formula" while messing with those graphical constraints. Or could be it's just implemented badly there...

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#12
One of the absolute worst things about iOS development is struggling with auto layout. Sure there are some things you can do with it that are hard to do in a box layout method but 95% of the time it's just a massive headache to achieve something you could do with flexbox or even Bootstrap in a much more transparent way. In fact, one of the most appealing things about React Native is that it lets you do iOS layout with flexbox.

So I'll pass on similar constraint-based approaches to HTML layout, thanks!

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#14

From their demo: structure.gss @h |-(#message)~-~(#follow)~-~(#following)-(#followers)-| in(#profile-card) gap($sgap) !strong { &[top] == &:next[top]; } } If you inject stuff like this into a project, make sure you're doing it solo. 'cause if you're on my team, i'll slap you. WTF is this voodoo? Less and Sass aren't complex enough? CSS isn't hard enough to work with as it is?

Sass might make it more complex, but after learning it you save an extraordinary amount of time. I also don't find CSS that hard to work with anyway though.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#15

I'd love to use this. But in the back of my head I still think javascript should be optional if possible ... not that 99% of the rest of the world cares ...

> javascript should be optional if possible I got a blank page so I closed the tab. Any page that requires javascript and I don't need to use (at the level of do my taxes) or that I don't trust the owners of gets the same treatment. So yeah optional javascript is a thing unless 100% of your audience are absolutely required to use your site. EDIT given that sites today use google analytics instead of their own server…

Actually there is oftentimes a static "non js" tracking-image embedded within a -tag.

Oftentimes this totally gets forgotten btw. And it is not only GA - it is Adobe Analytics, Heap, every conversion-tracker by Facebook and Adsense and the likes.

SO yeah - we (so called) web analysts know that and even have ideas/means to track the number of people that disable js by default or that block every form of (browser based) tracking.

tl;dr You get locked (most of the time), but you can block this (most of the time) as well.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#16

From their demo: structure.gss @h |-(#message)~-~(#follow)~-~(#following)-(#followers)-| in(#profile-card) gap($sgap) !strong { &[top] == &:next[top]; } } If you inject stuff like this into a project, make sure you're doing it solo. 'cause if you're on my team, i'll slap you. WTF is this voodoo? Less and Sass aren't complex enough? CSS isn't hard enough to work with as it is?

I can't tell if you're complainin about inherent difficulty in this stylesheet language, or just about introducing a new stylesheet language with a learning curve. If the former, I would disagree—it seems easier and much more useful than CSS to me. If the latter, well, any new language or technology has a learning curve, and it's rarely easy to know whether it will be worth learning.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#17

Earlier quoted context omitted.

> javascript should be optional if possible I got a blank page so I closed the tab. Any page that requires javascript and I don't need to use (at the level of do my taxes) or that I don't trust the owners of gets the same treatment. So yeah optional javascript is a thing unless 100% of your audience are absolutely required to use your site. EDIT given that sites today use google analytics instead of their own server…

Actually there is oftentimes a static "non js" tracking-image embedded within a -tag. Oftentimes this totally gets forgotten btw. And it is not only GA - it is Adobe Analytics, Heap, every conversion-tracker by Facebook and Adsense and the likes. SO yeah - we (so called) web analysts know that and even have ideas/means to track the number of people that disable js by default or that block every form of (browser based…

A company I worked for years ago actually had an analytics tool they sold that just used a transparent tracking gif. We managed to sell pretty expensive subscriptions way after Google analytics completely pwned its capabilities thanks to industrial companies being strangely un-web-savvy.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#18

Kudos! I've been thinking about constraint satisfaction solver for layout, and keep it in mind as a possible project for a future. Great to see someone shares this view and went on to implement it. I haven't studied this concrete project deeply, but the idea in general seems appealing, because CSS is hell. (The site says this constraint language is used in Apple products - I didn't know that).

Not sure what you mean that "css is hell", although I understand from working with a lot of programmers (I do front end they do back end) that CSS is seen as something you might also want to learn but not really because it isn't proper programming. CSS as it is now is incredibly powerful and works almost as it should (almost int he way all languages/technology are works in progress).

I can see this (GSS) as having its place amongst a developers list of tools, but ultimately I can't see how it is better than Flexbox, or why I would want to a javascript library to do layout, or who in their right mind would want to pass a project using this on to someone else.

Re: Grid Style Sheets – Replace CSS with a Constraint-Solver

#19
post #11
post #9

Constraints are the right approach to layout. This should have happened years ago. The important concept here is defining layout like this: #elmA[top-left] == "area"[top-left]; #elmB[bottom-right] == "area"[top-right]; The trouble with this is that it's expressed as a programmer's approach; everything is about variables, not geometry. Constraints should be input from a GUI, like Dreamweaver. To see what this looks li…

As a non-designer, I disagree. I played around with FreeCAD a bit, and I was constantly wishing "just let me enter the damn formula" while messing with those graphical constraints. Or could be it's just implemented badly there...

Newest XCode does this in the right way I think. It lets you do most of the stuff from the GUI (and detects conflicts), but you also have the power to enter constraints manually in the code.
Post reply on HN