Live data from Hacker News

Grid Style Sheets – Replace CSS with a Constraint-Solver

gridstylesheets.org

1–10 of 99 posts

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

#4

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 logs I wonder if non-javascript users just don't even get logged by the javascript-for-everything brigade?

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

#5
Lol, I have a post from years and years ago where I rail against 960 gs and the like "grid style sheets" for not being semantic, and about a year ago one of the authors of this emailed me asking me to amend it specifying that I wasn't talking about this. I declined, and went on to comment how the use of JavaScript for layout was even worse, lol. I was a little irritated at the hubris of the guy and may have gone a little overboard.

You can't choose such an incredibly generic name though and then expect all existing references to update, that's simply illogical.

Update: http://jdon.at/1cgIw the emails in question

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

#7
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?

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

#8

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 ...

I watched video of a talk by one of the guys who made this - he said they thought about making a static website generator like jekyll or something which would use the in-browser version to let you preview things live, then they'd have a tool to autogenerate with mediaqueries different versions of the stylesheet for different common screen sizes so you don't need JS. Sounds like a pretty cool compromise to me!

edit: the video I saw is actually that o'reilly video that's linked in the GSS website

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

#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 like done right, try sketch mode in Autodesk Inventor, where you can draw lines, circles, and arcs and constrain them to each other in various ways. Designers would love it if they could do layout that way, and we could lay off a few thousand Javascript programmers.

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

#10
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).

Post reply on HN