News for hackers. Stuff that matters.
Re:Descartes – An experimental library for writing CSS in Ja... by onion2k on Sunday February 21, 2016 @03:42AM (#11143821)
One advantage that a JS system could have over a preprocessor is the ability to use real values from the browser; for example you could set things to be equal to page height.

It'd definitely be much slower but that's irrelevant so long as it's still fast enough.

Re:Descartes – An experimental library for writing CSS in Ja... by david-given on Sunday February 21, 2016 @02:01PM (#11145898)
The two things I find myself persistently wanting to do in CSS, which I've never found a way to do, is:

- how do I make this element the same size as this other element?

- how do I make this element the same size as this piece of unwrapped text?

To be fair, these are both require multipass layout, which (IIRC) CSS is explicitly specced not to do. But it's still necessary for complex layouts. Unfortunately it doesn't look like Descartes can help with this.

...way back when there was a thing called famo.us, which was a pure Javascript layout engine; it claimed to be faster (and more flexible) than traditional HTML and CSS. The company that wrote it went bust, and it seems to have turned into http://famous.org. But I've never heard of anyone using it...

Re:Descartes – An experimental library for writing CSS in Ja... by juandazapata on Sunday February 21, 2016 @08:36AM (#11144431)
To set an element height to the full viewport height, you can use `height: 100vh`. That unit is available since 2011. Please do your homework.
Re:Descartes – An experimental library for writing CSS in Ja... by prezjordan on Sunday February 21, 2016 @09:47AM (#11144683)
No need to be pedantic, onion2k's original point that you can use values from the browser is spot-on. If you've ever tried to interact with CSS transitions/animations with JavaScript you'll find rather quickly that doing the entire thing in JS is the only reasonable approach.
Re:Descartes – An experimental library for writing CSS in Ja... by majewsky on Sunday February 21, 2016 @10:09AM (#11144762)
Okay, but then, since you're already animating individual elements, what's the benefit over jQuery's $.fn.css?
Re:Descartes – An experimental library for writing CSS in Ja... by onion2k on Sunday February 21, 2016 @11:47AM (#11145166)
I didn't mean the viewport. I meant the page eg the full height of the rendered window content including everything outside of the viewport's scroll region.