Grid Style Sheets for Constraint-based Layouts
raygun.io
raygun.io
So portable devices, and maximized desktop browsers would benefit, as they have regular dimensions.
I imagine they would precalculate the constraint "solutions" in the variables used inside the solver. GSS would still be supplied, and would still need to translate the solver variable values to CSS style values.
This way, if the window resizes, or has an initial size that is not precalculated, it can still be accommodated.
Precomputation - From small phones to large desktop, there are ~2million width & height combinations, even if solving a single screen size takes 10ms, were talking ~6hours. To get around this, using a sort of bisection method, we selectively solve for as few screen sizes as possible to test linearity of each variable's solved values. With Cassowary each variable is linear between breakpoints, making this possible.
Pure CSS Generation - Generate media queries & styles with calc() where calc is a linear function with respect to vw & vh units. A little JS we only be needed for browsers that don't support calc or viewport units.
Limitations - Precomputation will only work for deterministic / static layouts. For a highly volatile DOM, runtime will be needed, but that's probably OK given the fact that you're already using JS to mutate things in runtime.
Why not instead push for standards? Just a few months ago these guys were hyping this up even though it has tons of performance issues, bugs that the explicitly ignore, it doesn't work in IE and forget about getting this to work on mobile.
I'd really like to see for once, a dev get down and dirty and work on an actual standard instead of pushing out a JS solution that will be abandoned in 12 months time.
I'd like to see more polyfills of potential standards. Waiting years on end for things like CSS Vars or the Grid Layout Module is getting real old.
Instead of hating on JavaScript, the only turing complete tool we have in the browsers, we should be pushing for extensibility standards. API hooks into the internals of CSS selector resolution, layout calculations, etc so devs can add new features in a performant & predictable manner that may never trickle down from the ivory tower of standards.
Every javascript solution that becomes popular ends up informing those ideas the browser makers end up standardizing. CommonJS and RequireJS have both informed the ES6 modules API. All the promise implementations out there have informed the promises API in ES6. etc. etc.
All that hype led to nothing but an ugly API that is confusing and going toward nowhere. There are no scientific or studious concepts behind it, I really feel like those guys let us down.
"Famo.us the hype ware that has been coming soon for years?"
It's available at http://famo.us/ "There are no scientific or studious concepts behind it"
A retain-mode scene graph, the basis of famo.us, is definitely a tried and true computer engineering concept.Quick question: Have you actually used famo.us?
Disclaimer: I'm an engineer at famo.us.