News for hackers. Stuff that matters.
Re:CSS Absolute Centering by binarymax on Saturday August 10, 2013 @02:26PM (#6192095)
Thanks for that link, it is very enlightening. So much of CSS just feels like a total hack. putting something in the middle of an element should not be so hard! negative margins? ...absurd!

Why doesnt CSS just have a property like 'placement: center middle' or something.

Re:CSS Absolute Centering by lbenes on Saturday August 10, 2013 @03:17PM (#6192292)
CSS is the epitome of design by committee, only worse. It’s worse because some members had a vested interest for the standard to fail. As a result, we get threads like this from designers, and programmers; they're in a worse bind. It’s just not possible to efficiently hardware accelerate CSS.

Of JS/DOM/CSS in HTML5, CSS is the worst standard. Depreciation is the best we can hope for. I’m sure MS and Mozilla will fight it tooth and nail, but maybe Google will pull a Dart/Go here and give us something decent to work with.

Re:CSS Absolute Centering by emn13 on Sunday August 11, 2013 @04:34AM (#6194347)
I've got exactly the opposite opinion: of JS/HTML/CSS, CSS is y far the best standard.

People complain because it doesn't address their specific needs explicitly (e.g. vertical centering) - but that way lies madness; a huge spec that caters for every case explictly, and probably has lots of corner cases and interactions meaning that cross-browser support would be even harder than now.

CSS is limited - and that's a good thing. Would you want to implement complex layout in JS, say? And how that would look when window size changes, or the page is zoomed, or some font isn't available?

The declarative nature of CSS is what makes it work; and the key aspect of declarative here is that it represents a state, not an algorithm - it's not turing complete. You'll never be able to do everything in CSS; and that's by design.

Re:CSS Absolute Centering by slacka on Sunday August 11, 2013 @09:20AM (#6194889)
It's not an issue of turning completeness. CSS was never designed to be hardware accelerated. So many implementations run faster in software. Here's a good example:

http://stackoverflow.com/questions/10014461/why-does-enablin...

Re:CSS Absolute Centering by sergiosgc on Sunday August 11, 2013 @06:41PM (#6196628)
CSS is thought out for it to be possible to implement a fast layout engine. This requires a few concessions. One concession is that it (mostly) requires that layout defined by a partial document is the same when the document is complete (to allow for documents to be laid out on the screen as they come in from the slow network).

A placement: middle, without a rigidly defined height, would require the layout engine to know about document information after the element requesting a middle placement.

Re:CSS Absolute Centering by saraid216 on Saturday August 10, 2013 @04:07PM (#6192465)
People complaining about CSS usually complain about the illogic of cascading, which I don't understand. This, however, captures the weaknesses of CSS a lot better. CSS is strong when it comes to styling text, but weak when it comes to doing layout.

It would be nice to see a complete overhaul of how presentation is done, with what people have sought to do on today's web in mind.

Re:CSS Absolute Centering by ricardobeat on Saturday August 10, 2013 @07:11PM (#6193019)
That's what flexbox does, mentioned at the end of the post, it just doesn't have enough support yet.
Re:CSS Absolute Centering by jgon on Saturday August 10, 2013 @11:28PM (#6193715)
Does flexbox support the centering of elements like the canvas and a webgl context? Does it offer facilities for resizing either of these elements? If not, is there anything out there that allows for resizing these elements with the rest of the page?
Re:CSS Absolute Centering by ricardobeat on Sunday August 11, 2013 @12:15AM (#6193806)
Yes, you can use percentage units.