6 ms·
The fact that this is an interesting article is a huge indictment of CSS. It was developed for a different, simpler use case, and it's obviously the wrong abstr
by pmichaud 13y ago
The fact that this is an interesting article is a huge indictment of CSS. It was developed for a different, simpler use case, and it's obviously the wrong abstraction at this point. Too bad it's entrenched.
- brandonbloom 13y agoI've been saying this of JS/HTML/CSS for years, but people seem to suffer from severe stockholm syndrome.
- morley 13y agoWhat do you suppose we do about it? Like it or not, people use web browsers to access the Internet, and as long as web browsers render HTML and CSS, we have to use the tools we have.
- brandonbloom 13y agoMy complaint is that a lot of people like CSS/HTML/JS. Because they have learned it and gotten comfortable with it. They don't know/understand anything else and their identity and sense of self-worth is challenged if you speak ill of these technologies. That's a big problem. Pragmatically: I suppose that we embrace CSS/HTML/JS as object code. And I mean this in a much more dramatic way than CoffeeScript or SASS. This is finally starting to happen, thanks to browser support for things like source-maps. This is one reason I contribute to ClojureScript! Idealistically: We should be pushing for lower level platforms for code distribution and execution, as well as host platform integration. Portable Native Client and similar efforts shouldn't be so controversial.
- Zikes 13y agoThere have been attempts to fix this by creating languages which compile to each of those: HAML for HTML, CoffeeScript/Dart for JS, SASS/LESS for CSS. The language benefits tend to be fairly obvious, but there hasn't been much of anything in the way of native browser adoption that I've seen yet, apart from Google's plans for Chrome & Dart.
- RaphiePS 13y agoNow, I haven't used SASS/LESS that much, so feel free to correct me, but it seems like they're solving a different problem. They keep your code DRYer, add nice things like mixins, etc. However, they don't abstract over tasks like layout--you're still stuck with hacky CSS tricks and semantics.
- masklinn 13y ago> Now, I haven't used SASS/LESS that much, so feel free to correct me, but it seems like they're solving a different problem. You're correct, but that hasn't stopped people from trying.
- hnriot 13y agoyet, despite this the web seems to be doing just fine, apps are powerful, often better than native and nobody (else) seems to be complaining that much. Sure, some things take actual skill to implement. We live in an imperfect world, and while it's always easy to blame the tools, it's far better to just get on with improving things and making the best of what we have. It's a far better world today that the setup.exe days.
- Pxtl 13y agoThe entire combined might of the 21st century computing industry has managed to make the dominant application platform provide a tolerably good application experience on a dual-core multi-gigahertz machine. Whoopee.
- lambda 13y agoCSS was originally designed only for inline and block layout in a traditional single column of text with left or right floated figures. It has never had any features specifically designed for full page layout, but people have done lots of hacks to use inline, block, margins, padding, and floats to achieve full-page layouts they were never designed for. There have been improvements in CSS2 and CSS3, like adding table layout so people could at least use the table layout features on div elements rather than abusing tables for layout, and CSS flexbox that work well for standard UI widget layouts. But the big fixes to layout have been harder to specify and agree upon. They've been in the works for many years, but it's taken a while to figure out how they really should work, and which parts should be fundamental. It looks like it's getting a lot closer; the CSS Grid Module http://dev.w3.org/csswg/css-grid/ http://dev.w3.org/csswg/css-grid/ is being treated as the fundamental part of the stack on which others will build, it is being worked on by several browser vendors and is in highly active development, and several browsers have implementations in development. It seems to draw elements from IE's experimental CSS grid, as well as the templates of the earlier template layout proposal. So, yeah, for many years CSS has had a big deficiency in specifying page layout. It's going to get better very soon, however, once the CSS Grid Module is finished and implemented. I'd imagine we'll start seeing implementations within a year; here's Webkit's tracking bug for it: https://bugs.webkit.org/showdependencytree.cgi?id=60731&hide_resolved=0 https://bugs.webkit.org/showdependencytree.cgi?id=60731&hide... here's Chromium's: https://code.google.com/p/chromium/issues/detail?id=79180 https://code.google.com/p/chromium/issues/detail?id=79180 . Mozilla doesn't seem to be working on it yet, though they have had some preliminary discussion: https://bugzilla.mozilla.org/show_bug.cgi?id=616605 https://bugzilla.mozilla.org/show_bug.cgi?id=616605 . IE had implemented an experimental Grid Layout proposal that the current work is based on, so while the syntax won't be exactly the same, they have most of the underlying functionality working: http://msdn.microsoft.com/en-us/library/ie/hh673533(v=vs.85).aspx http://msdn.microsoft.com/en-us/library/ie/hh673533(v=vs.85)...
- masklinn 13y ago> But the big fixes to layout have been harder to specify and agree upon. They've been in the works for many years, but it's taken a while to figure out how they really should work, and which parts should be fundamental. It looks like it's getting a lot closer; the CSS Grid Module Although lower-level and not as modular, flexbox can already be used with great success for a number of layout sections (media objects, vertical centering, input inserts) or full layouts ("holy grail", sticky footers and grids): http://philipwalton.github.io/solved-by-flexbox/ http://philipwalton.github.io/solved-by-flexbox/ Flexbox is a CR, and it's starting to get pretty well supported: http://caniuse.com/#feat=flexbox http://caniuse.com/#feat=flexbox
- potch 13y agoName another software runtime that even partially works as well cross-platform. Or another runtime that has the notion of multiple competing implementors.
- JakeSc 13y agoDo you have a better suggestion? I agree with your frustration about this article being newsworthy (it's 2013! How are we still figuring out vertical centering?!), though I would argue that CSS is great for its original use case and certainly has its place today. Why is it bad that CSS is entrenched in the Web? Like any development technology, CSS has a learning curve and has several shortcomings (like vertical positioning), but I think it's a fine tool for the job and struggle to come up with something better.
- gcv 13y agoCSS is not great for its original use case. It was poorly designed by a group of people who chose to ignore existing understanding of layout models. The TeX boxes+glue model, had it been adapted for CSS, would have made all the absurdities and nasty layout workarounds of the last 20 years unnecessary.
- Pxtl 13y agoI like to point to the failure of keeping table headers visible at the top of a page as you scroll down a table. If I had a book where a table spanned multiple pages and the header row wasn't included at the top of the page, I would throw the book out. A scrollable table with fixed headers is something that Visual Basic supported in 1997.
- anon1385 13y agoUnsurprisingly people have been trying to get browsers to support for that for years and years e.g. http://lists.w3.org/Archives/Public/www-style/2002May/0153.html http://lists.w3.org/Archives/Public/www-style/2002May/0153.h... Of course it wasn't a use case of interest to the mighty browser vendor cabal so it has never been considered a priority. It does seem like it will be possible soon though with position:sticky https://air.mozilla.org/intern-presentation-ford/ https://air.mozilla.org/intern-presentation-ford/ We should probably prepare some sacrifice to the browser vendor gods to thank them for this small morsel they have thrown us.
- nostrademons 13y ago
- untog 13y agoThere's nothing wrong with CSS the language. There are missing properties that could be better implemented, and hopefully future browsers will do so. But CSS is still a fine base to work from. That said, I use LESS. But while everything compiles down to CSS, it doesn't impact me much.
- svachalek 13y agoI think I can counter that in two words: specificity hierarchy.
- masklinn 13y agoFixes are (finally) coming in for layout in CSS in the form of flexbox (http://philipwalton.github.io/solved-by-flexbox/ http://philipwalton.github.io/solved-by-flexbox/) (and mayhaps grid layout, we'll see. You can create most layouts with flexbox but it's pretty low-level, grid works at a higher level and looks more modular but has seen less implementation so far)
- Pxtl 13y agoYup. Easy things easy and hard things possible, like Wall always says. Centring a box in the middle of the page sounds "easy".
- melvinmt 13y agoI used to think that as well, until I tried to implement the equivalent of <div style="padding:5px;margin:5px;">variable text</div> in an iOS TableView. CSS makes life much, much easier.
- JungleGymSam 13y agoThis is the first thought that came to my mind when I read the headline (your first sentence). Glad to find out I'm not alone.