Eric Meyer: The King of CSS
Eric Meyer is considered by many as the go-to expert on CSS. Web Designer caught up with him to discover exactly what his thoughts are on the current state of CSS, and what the future holds
CSS and Eric Meyer have gone hand-in-hand for over fifteen years. He is an internationally recognized expert on the subjects of HTML and CSS – what this man does not know about CSS is not worth knowing. Eric is an established author and has written a number of acclaimed books including the self-titled Eric Meyer on CSS, More Eric Meyer on CSS, and more recently he has added his expertise to the Smashing Book series with Smashing CSS. Beyond the written word, Eric is a prolific speaker and can be found headlining many a web conference. Eric Meyer is undoubtedly the king of CSS. Long may he reign.
You’ve been at the forefront of the CSS revolution for a long time now. How do you rate the latest version of the specification and what do you think can be done to push it forward?
The stuff that’s being worked on right now is really hard but really awesome – really powerful layout mechanisms, visual filters, useful but processor-heavy selectors, and so on. It really feels like we’ve solved, for the most part, most of the basically easy problems, like setting solid colours or having background images or defining borders. Even a lot of the medium-hard problems have been dealt with. Now we’re moving into the really rough territory, where it’s an incredible challenge to create powerful, complex tools that can still be described (and thus written) using simple syntax. Decisions of any sort can have huge long-term consequences, so it’s tricky to navigate. So I rate the latest work very highly for ambition and potential. Forward progress may be a bit slower than we’ve seen lately, but there is need for caution. And, of course, any complex system is at least as hard to implement as it is to define. Browser teams are limited in terms of time and resources, so some things will be deferred, and that will be frustrating. Bear in ,mind what I’ve always said, though, “Never put down to malice what can be more adequately explained by resource constraints.”
Browser support is a key factor behind the adoption of the latest CSS standards. Vendor prefixes help widen support, but why is it that all browser vendors cannot agree on a standard code of support?
They can, and often do. The devil is always in the details, and in the assumptions programmers make. For example, the CSS specification currently says of box and text shadows:
“A non-zero blur distance indicates that the resulting shadow should be blurred, such as by a Gaussian filter. The exact algorithm is not defined…”
Right there is an inconsistency waiting to happen. Yes, the spec goes on to give an approximate guide to how shadows should be blurred, but the algorithm is not precisely defined, so it’s up to each browser team to devise their own algorithm. What are the odds they’ll come up with precisely the same formula? You might think the answer is to define a precise algorithm, but what happens if later on a serious flaw is found, or if a better algorithm is devised? CSS has long employed intentional ambiguity to allow browser makers to experiment and find the best ways to do things. There’s also the problem of interaction. CSS can define the behaviours of properties foo, bar, and baz, and browsers can implement them all so that they consistently pass all their individual conformance tests. What happens when they’re used together, though? You could get wildly different results just based on slightly different resolution code deep inside the various rendering engines – say, if baz is handled before bar in one browser, and that order is switched in another. And that’s just with three properties interacting. How many properties did you have in your last style sheet? Basically, the only way to have perfectly consistent implementations is to have one browser. We had that once, when there was only World Wide Web, the browser Tim Berners-Lee wrote. But it was Mosaic that ignited the popular web, and Netscape that shot it into orbit. Anyone who thinks browsers are horribly inconsistent now should look at that period of history. The divergence was extreme, bad enough that the same page would look wildly different across browsers, and it happened regularly. Madness! But now we know better.
The introduction of high-resolution displays has brought a new challenge to designers and developers. Pixel ratio is the current solution, but do you think there is better answer?
I honestly think that pixel-based images are about to become an endangered species. Anything that can be vectorised will be – and I remember seeing demonstrations in the Nineties of vector formats for photographs and the like. It would not surprise me in the slightest to see those ideas make a comeback.
Web fonts have revolutionised web design, but how can the standard move forward and what else does it have to offer?
I’m not a typographer, so that’s hard for me to say. I know that type enthusiasts are all excited about ideas like the ability to define ligature pairs and finer-grained control over kerning and the like, but when they talk about that stuff I’m like your grandma listening to you talk about work – there’s a lot of nodding in pauses for breath and me saying, “That all sounds lovely, dear. Would you like another cup of tea?” I’m not trying to say that those things are irrelevant or useless. They aren’t! They’re just in a realm that I don’t really grasp. I mean, I’m the guy whose results on ‘which font is this, Arial or Helvetica?’ quizzes are statistically indistinguishable from random guesses. Which, let’s be honest, is what they are.
Responsive design is a key component of the site-building process. However, currently it is in the early stages of its lifecycle. How do you see responsive design evolving in the short-term and long-term?
It’s a great question, and one I think we’ll all have to answer together. We’re still figuring out what works in what circumstances and finding out how old assumptions by browsers are clashing with the aims of responsive design – like, how browser prefetching (which is meant to speed up browsing) means an enormous increase in page weight when you’re pointing to a lot of different media-specific style sheets. Responsive design is also pushing the edges of questions few of us thought about before: can the same content serve equally well in multiple media? Can the same page be useful cross-platform? I personally think the answer is, ‘sometimes’, but maybe I’m wrong. Maybe, as a result of responsive design, we’ll find new and better ways of presenting content across all media. It has that potential.
The CSS standard is a constant work in progress. How long do you think it will be before CSS4 hits the web and what would you like to see in it?
We can’t really talk about a CSS4 because there are no monolithic CSS specs. The last of those was CSS2.1, and I doubt we’ll see one again. Now we have dozens of CSS modules, each proceeding at its own pace. Take Selectors for an example: Level 3, what we might call CSS3 Selectors, is a full recommendation now, and Selectors Level 4 is well underway. In the meantime, a whole bunch of Level 3 modules are wandering around in working draft phase. Some of them could still be there when Selectors moves to Level 7. So now we have to talk in terms of the next period of time. I think over the next year or so we’re going to see a ton of movement in the area of advanced layout, finally, with modules like GridLayout, FlexBox, Regions, and Exclusions. Those four together could create an enormous shift in the kinds of layouts we create as well as how we structure them. CSS Filters are very interesting, too, though I’m not sure how popular they are to implementers other than Adobe, and as I said before, Selectors continue to barrel ahead. I’m also hoping to see some advances in colours and backgrounds, but the priority right now is layout, which is really where it belongs. We’ve needed this stuff since CSS was first written.
Finally, on a more personal level, are your goals the same as they were five years ago and what do you think you will be up to in five year’s time?
Broadly speaking, yes, they are, and I think they will be. My goals have always been to explain how to make websites with CSS by explaining how CSS works, and to thus help the whole community advance the web. It’s sort of like being a woodwork teacher who shows the class how to use all the tools safely and properly, so they can produce whatever masterpieces their hands and vision can bring forth. I could do that my whole life, I think, and thereby count myself luckier than most.