Several months ago, I attended a fascinating talk on CSS3 by Peter Gasston at London Web. As one of the first people to ask a question during the Q&A session at the end of Peter’s talk, I received a free copy of his The Book of CSS3: A Developer’s Guide to the Future of Web Design. Unfortunately, my own manic schedule meant I had to put the book to the side for a while. But now I’ve managed to read it from cover to cover, I’d like to share my thoughts about it.
Let me say it right out: Peter has done a splendid job. The book is extremely well researched, and he obviously knows what he’s talking about. Having said that, the book’s subtitle (A Developer’s Guide to the Future of Web Design) very much sets the tone. If you’re looking for a quick guide on how to create CSS3 eye candy with rounded corners and drop shadows, this is not the book for you. Although Peter covers the relevant properties (
box-shadow), he takes a much more serious approach through an in-depth exploration of each new property, together with warnings about anomalies in different browsers. Because CSS3 is still evolving and browser makers are bringing out new versions at a breathtaking pace, you might think that Peter’s book will rapidly go out of date. Undoubtedly, some parts of it will; but many of the CSS3 modules that Peter covers are unlikely to change. Color is already a W3C recommendation. Selectors is a proposed recommendation; and Media Queries, Backgrounds and Borders, and Multi-column Layout are all candidate recommendations. As a result, The Book of CSS3 is a reference book that I’ll be keeping by my side for a considerable time to come.
Even the more experimental areas covered by the book are not really a problem, thanks to the decision by all mainstream browsers to adopt browser-specific prefixes (such as
-moz for Firefox and
-webkit for Safari and Chrome) until the specifications settle down. Unlike CSS2.1, you won’t need hacks to deal with quirky implementations in older browsers. Just use the browser-specific prefixes in combination with the standard properties. Older versions use the prefixed properties, and when the specification stabilizes, the most up-to-date version will use the standard ones (as long as you put the standard ones lower down in the cascade). Perhaps one exception is the Flexible Box (flexbox) Layout module. Just as the book was going to press, the W3C decided to completely rename the properties. Peter mentions this at the end of the chapter on flexbox layout, but the changes haven’t yet made it through to the browsers that support it (Firefox, Safari, and Chrome). However, they will presumably continue to support the old properties with the browser-specific prefixes. But until Internet Explorer supports flexbox (planned for IE 10), using this type of layout is of limited value anyway.
Although flexbox and other proposed layout systems don’t have much practical value at the moment, I found the chapters devoted to them among the most interesting in the book—mainly because they give me hope for the future. CSS layout has always been a minefield, but if browsers (and the W3C) continue the current rapid pace of development, the job of the web developer should become a lot easier. Or will it? One of the comments in the Q&A session after Peter’s talk was that CSS was becoming more like a programming language. And it was obvious from the questioner’s tone that the thought of handling more code was unwelcome. But if you’re involved in designing websites and want to understand the direction in which CSS is moving, Peter Gasston’s book is an excellent place to start.