Nov 10

Practical CSS3: Develop and Design, a book review

Earlier this week, in an argument, someone pointed out that I have hardly any books in my house. Not so, I retorted angrily. I’ve got hundreds. They’re just all in boxes in the shed, because I’m in the process of moving house.*

And it occurred to me: I haven’t missed actually having the books around. Much. Every now and again I’ll rummage through a box and pull out a book, mainly so the littlest room in my house has something to read in it. But that’s rare. And I got to thinking: actual books? Really? Well, I read fiction, but non-fiction stuff, that’s all on the internet now. What’s the point of a book, particularly a technical book?

Well, there is a distinction, I think, between reading stuff on the web, as it arrives, in dribs and drabs, in no particular order… and actually getting a good, solid overview of an area. A technical book isn’t really about new information: it’s about organisation. About someone pulling together a big pile of disparate stuff and making a consistent narrative out of it. I’d almost forgotten, I think, the pleasure of having someone else work out what’s important and then distill it for me. When you read a well-written technical book, you’re the Prime Minister; your author is collating a world of shades of grey into a succinct, crisp report so you can understand what’s going on.

This is a valuable service. More valuable than you may at first think.

It’s also a valuable skill to have. It’s not easy, taking a world full of contradiction and making it clear. Book authorship is more than just putting words in the right order and then buying a Lamborghini Aventador with the proceeds, you know.

There’s a lot going on with the web right now. People inventing specs, browsers implementing them or not implementing them, the old order changes, the centre cannot hold. I’m sure there are people who manage to follow all of this — and I in turn follow them, on Twitter, normally — but I mostly don’t have the time or, to be frank, the inclination to spend my life tracking the internecine wars. What I want to know, in the words of Alexis Deveria‘s fantastic site, is can I use this?

Which brings me to Chris Mills.

Now, Mills is a friend of mine, in addition to being basically a walking metal cliché* and a thousand feet tall. We’ve spilled the same beer in the same mud, to misquote Marines the world over. So, when he said he was writing another book (this is a man who writes about the web for a living, so there’re a lot of words out there with his name on them), I was interested. And, kindly, he spotted me a free copy of it, which is appreciated.

And thus, Practical CSS3: Develop and Design was born unto the world, and borne unto me.

Given the whole books-in-boxes thing, I was pretty pleased to see that there’s an ebook version — and ePub to boot. No stupid, stupid Adobe DRM crap here (well done Peachpit, the publishers, for not locking the book; it is watermarked with my name, but I’m basically OK with that). I could get the book and read it on my phone, which is where I read everything these days, even in the littlest room. And that’s how I think technical books like this should be read; from cover to cover. Not as reference; as entertainment, as something where you read a chapter and then the ideas within it settle into your head to be dug out later. Where you find yourself thinking, six months from now, “didn’t I read something about using rems for font sizing? Now where was that?” and return to the book for details. It should be a seed of ideas, a low-impedance way of getting All The New Stuff into your head and having fun meanwhile.

Mills’ book manages that with aplomb. Take rems, for example, since I mentioned them earlier. I was — and I’m not kidding in the slightest here — halfway through the section about sizing text in rem units before I realised that it was serious and not some kind of huge piss-take aimed at Remy Sharp. Not because Mills suggests it is in any way, but because I was enjoying reading. Rems are real (as is Remy). They’re useful, too, and I’d never heard of them: a font-size in rems is relative to the size of your <html> element, not relative to the size of the parent element. So all of this .786em stuff goes away; you can now make text the size you want without having to bust out some sort of calculator widget.

The book’s eminently practical, too, explaining a bunch of stuff that’s going on right now (flexbox styling, responsive design, animations, border-images) and giving sensible advice on actually using this stuff via polyfills, fallback content, and the like. Unsurprisingly for someone who works for Opera, Mills is not about pushing the latest only-works-in-one-browser tricks; there are copious examples and explanations about when and where to use a technique, rather than just how.

Of course, nothing’s perfect. (“Perfection is finality. Finality is death. Nothing is perfect. There are lumps in it.” as Peter S. Beagle put it.) There are a couple of editing errors (references to things like transformX: translate(200px) which ought to be transform: translateX(200px)) which I’d have expected to be caught by a technical editor; there’s an animated form example (from the (downloadable) set of code examples) which doesn’t seem to work in Firefox 16, which surprised me; and the thing’s 35MB, which is pretty large. But these are minor quibbles. If I were looking for a reason to have a pop at Mills, I’d say that the whole section on making icons with pure CSS, while it’s alarmingly clever (and has been for a while; I was blown away by Nicholas Gallagher’s original pure CSS icons), doesn’t really belong in a book which is careful to talk about semantics and discourage adding a bunch of meaningless markup to your sites just to get some presentational effect. But this is, at best, a venial sin rather than mortal. I enjoyed reading the book; I learned from it — not really the underlying world-view, with which I was already sympathetic, but real detail about the cutting-edge of CSS3*; and I’m glad it exists. If you want to feel like the Prime Minister and have your Secretary of State for CSS3 Stuff write you the report you really need on what the web can do in 2012, you could do a lot worse than Mills’s Practical CSS3: Develop and Design.

3 thoughts on “Practical CSS3: Develop and Design, a book review

  1. spacer Marius Gedminas says:

    The footnotes appear to be missing, when I read this post on Android.

  2. spacer Marius Gedminas says:

    The above might be caused by the inherent difficulty of hovering over a link on a touchscreen device.

  3. spacer sil says:

    Marius: correct. In the old design I had some JavaScript that made them clickable, but it got lost in the redesign. I’ll fix it spacer

Leave a Reply Cancel reply

Your email address will not be published.

You may use these HTML tags and attributes: <a class="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>