Earlier quoted context omitted.
Layout can only expand/overflow to the right and down, not up or left. Although not fundamental, this has been a standard and useful design limitation in almost all software from the start: infinite drawing canvases are the only counterexample that immediately occurs to me. (“Pull to refresh” is almost another exception.) I’ve seen sites that centred in a way that caused balanced overflow while assuming a wider viewp…
> The result was a completely unusable site: the middle half was in-viewport (good), the right quarter was accessible by scrolling (poor), but the left quarter could not be accessed at all (abject failure). This is the limitation that browsers/css impose for a rather arbutrary reason [1] There's nothing preventing the browser from scrolling in any direction. [1] It's not arbitrary, of course. But almost all these qui…
Should CSS be constraints?
41–46 of 46 posts
Re: Should CSS be constraints?
#42Nice margin notes trick: float: right; margin-right: -12em;
Re: Should CSS be constraints?
#43Apple's native SwiftUI framework and Google's Jetpack Compose framework stumbled upon basically the same layout system, "Constraints down, sizes up": 1. Proposal: The parent component proposes a size/constraints to the child 2. Measurement: The child component picks its own size based on those constraints 3. Placement: The parent component then positions the child in its coordinate space It's all done in a single pas…
Re: Should CSS be constraints?
#44> But with constraint-based systems, the layout might be literally under- or over-determined, in the sense that there might be more than one, or less than one, layouts that satisfy your rules. This is under the "what's wrong" section but it doesn't actually say what's wrong. Obviously if over-specified, the extra constraints can't be followed which wouldn't be intuitive (and... css does this constantly, so it doesn't…
Author here. The problem isn't the technical challenge of writing a constraint solver. It's making sure that the resulting layout looks good, despite contradictory guidance from the designer. Yes, a constraint solver can figure out which constraints it's violating. And for under-specification, it can produce a layout that satisfies the constraints. But the layout the constraint-solver chooses might be really bad—if a…
I do feel like I can speak on this some authority.
predictability is again suffers.
And recall that everything in parameterized.
Re: Should CSS be constraints?
#45Grid Style Sheets / GSS was an implementation of this idea. https://gss.github.io/guides/ccss I saw was because I do not think anyone has used or maintained it since the company behind went belly up. But the code is still out there as open source, probably can be learned from. Disclaimer: I used to contract for them, but in other areas.
Hello Jon! This is Yarik. Cool to see you doing all this machine learning work these days.
Re: Should CSS be constraints?
#46Grid Style Sheets / GSS was an implementation of this idea. https://gss.github.io/guides/ccss I saw was because I do not think anyone has used or maintained it since the company behind went belly up. But the code is still out there as open source, probably can be learned from. Disclaimer: I used to contract for them, but in other areas.
If I am to provide a summary of why layout shouldnt be linear constraints, is that it can't faithfully represent content overflowing onto multiple lines. I.e. it's inherently one dimensional. I.e. you can't really have a layout that adaprts to the screen size without creating a lot of separate breakpoints. This is a big limitation, that for example flexbox doesnt have. When I left Grid i immediately went and reproduc…