Live data from Hacker News

Grid Style Sheets – Replace CSS with a Constraint-Solver

gridstylesheets.org

81–90 of 99 posts

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

#81

I don't trust a layout engine whose webpage advertising the engine has centering issues... iPhone 5s in portrait does not center the section starting with 'Polyfills' but does so in landscape mode; I'm pretty sure this was not the expected design.

The bottom is cut off as well. Where it says e-mail address and then something else but you cannot see it. Like this idea but this looks a bit bad for someone offering a solution to css bad parts :/

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

#82
post #40

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?

> 'cause if you're on my team, i'll slap you Because you're so macho, right? And anything you don't understand shouldn't be used. [EDIT] I find the sample code quite readable -- as long as one understands that it does more than constraints in that example, and that you of course have to read on the symbols to get them, like you'd have to read on Ruby's @, C's * and &, on regular expressions, etc. But this macho talk…

What about your point here?

Do you intend to turn a technological frustration talk into a gender (in)equality debate?

Personally I got that he's just expressing how absurd would be to see something as odd/complicated as that code trying to solve a problem that is inherently due to the complexity (inefficiency maybe) the current CSS model/spec.

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

#83

As GUI dev who worked with Apple's AutoLayout extensively I can confidently say constraint-based layout is a trap. It looks like more intuitive way to go on simple examples, but complexity spikes quickly as number of controls goes up. It's more complicated, more resilient to changes (harder to maintain), easy to get wrong, hard to understand and debug, bugs generally look uglier (what would be minor misplacement in C…

Agreed.

The correct answer (for desktop) is canonical grid based layout. (1)

I created DesignGridLayout, a manager for Java Swing. You add rows of widgets, the manager figures out optimal placement.

https://designgridlayout.java.net/grids.html

Every time I see mention of grids and CSS, I get a little bit excited. Then I see it's not based on canonical grids and I leave sad.

Maybe I should have "ported" DGL to HTML/CSS/JS, but I haven't figured out how (yet).

For mobile, I reserve judgement. I've heard good things about AutoLayout. But it'll be hard to replace my strategy of creating custom managers as needed.

(1) Except maybe for dynamic insertion and removal of controls. I'd have consider a few cases.

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

#84

As GUI dev who worked with Apple's AutoLayout extensively I can confidently say constraint-based layout is a trap. It looks like more intuitive way to go on simple examples, but complexity spikes quickly as number of controls goes up. It's more complicated, more resilient to changes (harder to maintain), easy to get wrong, hard to understand and debug, bugs generally look uglier (what would be minor misplacement in C…

When I first heard of GSS I thought it was the holy grail of layout systems for app (not document) layout. On the surface, and as you mention, with simple examples it is deceptively alluring. However it quickly becomes apparent that the issues with regard to bugs and broken/cyclical dependencies far outweigh any benefits the system brings.

Maybe a hybrid approach would be best? Constraint-based for the broad strokes and then regular box-based layout within these blocks.

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

#85
I found the picture at the top to be a funny reflection of the problems of layout. The bird (I believe that's a cassowary as on the book cover) in a spacesuit is an interesting juxtaposition artistically, but the helmet face plate won't be able to rotate down over the birds beak and seal the helmet. A 'layout' case that the image didn't consider. Layout is hard.

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

#86

As GUI dev who worked with Apple's AutoLayout extensively I can confidently say constraint-based layout is a trap. It looks like more intuitive way to go on simple examples, but complexity spikes quickly as number of controls goes up. It's more complicated, more resilient to changes (harder to maintain), easy to get wrong, hard to understand and debug, bugs generally look uglier (what would be minor misplacement in C…

I saw the headline , didn't even read the article and came here to say this and saw your comment. I've been struggling with auto-layout for about six months now. I finally get it but there's a certain impedance mismatch between how you want your elements to be laid out and what constraints are required to achieve the same result. Humans beings aren't wired to intuitively think like a constraint solver. I'm not an exp…

Perhaps the right approach would be to still use constraints to describe the layout, but to infer those constraints from examples provided interactively by the designer. The workflow would be:

10 designer creates an initial mock-up

20 designer re-sizes the window / uses another device

30 designer alters the style on that new format, re-sizing boxes, changing font sizes, etc.

40 constraint solver finds a minimal set of constraints consistent with the designer wishes

50 goto 20

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

#87

Earlier quoted context omitted.

I saw the headline , didn't even read the article and came here to say this and saw your comment. I've been struggling with auto-layout for about six months now. I finally get it but there's a certain impedance mismatch between how you want your elements to be laid out and what constraints are required to achieve the same result. Humans beings aren't wired to intuitively think like a constraint solver. I'm not an exp…

Perhaps the right approach would be to still use constraints to describe the layout, but to infer those constraints from examples provided interactively by the designer. The workflow would be: 10 designer creates an initial mock-up 20 designer re-sizes the window / uses another device 30 designer alters the style on that new format, re-sizing boxes, changing font sizes, etc. 40 constraint solver finds a minimal set o…

Some sort of genetic constraint generator, where the fitness function is examples provided by designers?

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

#88

Earlier quoted context omitted.

Perhaps the right approach would be to still use constraints to describe the layout, but to infer those constraints from examples provided interactively by the designer. The workflow would be: 10 designer creates an initial mock-up 20 designer re-sizes the window / uses another device 30 designer alters the style on that new format, re-sizing boxes, changing font sizes, etc. 40 constraint solver finds a minimal set o…

Some sort of genetic constraint generator, where the fitness function is examples provided by designers?

The examples are meta-constraints. The fitness function is the parsimoniousness of layout constraints, under the constraint that they reproduce the examples.

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

#89
post #42

Earlier quoted context omitted.

> 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. It's not like that behavior matters. That's about 0.001% of computer users. Might as well say "If it's not available in Gopher format I don't care".

Yes but that 0.001% are within the influencial 1% of users. I've literally had people see what webpages look like in my browser and then ask for no script installed. I didn't understand why until a few minutes ago but I do now.

>Yes but that 0.001% are within the influencial 1% of users.

No, they just believe so about themselves.

Post reply on HN