I recently did CSS/HTML and WordPress theming for Tom’s My Card. My Work. blog. Normally, I would get all that excited about a WordPress theme, since I’ve done several, but this one had a lot going for it from a CSS perspective. I’m actually really excited about it.
What’s so special about this one, you ask?
Well, for starters, there’s only one style sheet (1!) and in that one style sheet there’s a total of 0 (zero) rules included for a specific browser. It’s true. Actually, as the last step before I published it out to his server I deleted the lines in my template to pull in an IE6 or IE7 sheet. They were empty
Across everything else? It just works. No hacks. No weird code. No nothing. Just one style sheet that works in pretty much every major (and minor) browser. I mean it, too- I tested the home page* in Browsercam and it only really fails on browsers that I don’t care about at all- IE5.2 on the Mac, Netscape 4.78, IE5.0 and IE5.5, etc.
I have seen the future**, and it is one style sheet with no hacks.
Hallelujah.
In fact, when coupled with another technique I used for the first time in this layout (using overflow:auto to clear floats) and the fact that it’s fully em-based and scales like a dream, this layout is probably the cleanest I’ve ever done- at least in terms of CSS.
Some time soon I’m going to clean the markup up further to get it in line with the level of the CSS in terms of cleanliness (I didn’t fully craft every line in the theme, using some default markup in places,) re-skin it and publish it out as a theme for folks to download. That’ll be pretty sweet.
Beyond that, which is going to take a little while so I’ve got to do something to tide you all over, I’m going to detail some of the techniques at play in the layout later on this weekend, starting with a head-slapping, *doh* filled post about the magical powers granted by my newfound knowledge of overflow:auto.
overflow:auto!
*Bugs will shake out in both the home page and other pages. I know this.
**Frighteningly it fails in IE8 beta, but then again it is a beta (fingers crossed)