Generated Semantic Classes II: For CSS Artists
Scott and I are getting a lot done on this Sandbox theme: more classes, better markup and a little admin page that lets you choose stylesheets. The farther we get into the project, I think we’re doing this for CSS artists more than anyone. I’d be working on it now but Scott is carrying the code torch at the moment so I’ll blog about it.
The classes now include several data points that we had never thought of including before. Some of these come from existing problems. How do you know if a comment was written by the post’s author? The bypostauthor class makes this data available to CSS and javascript. What if you want to differentiate registered users’ comments from the braying of barnyard animals? Classes byuser and commentauthor-n make it possible. What if you want to rotate stylesheets for different times of day or year? Classes h00-h23, d01-d31, m01-m12, and y2006-etc. are your panacea. Oh, you wanted to style posts based on their timestamps? p-h00…
These classes are definitely overkill but that’s exactly what we’re going for. Did you predict c-h00 for comments? It’s in there. The more classes we add, the richer we’ll be in terms of people trying to use them in CSS and javascript. We’re doing this for the artists, not the bandwidth-pinchers. No pinch, no pinch. Even so, it’s super-simple to remove unwanted dynamic classes. Just find <?php sandbox_post_class() ?> and replace it with post or whatever.
The HTML we generate now is better than it was before, and probably better than most existing themes, but it’s not perfect yet. In coding this theme, my primary intention has been to empower CSS artists. That includes generating pretty HTML. If you have to indent the HTML by hand just to understand it, you aren’t going to enjoy skinning it. The secondary goals of making bloggers and blog readers happy will be very well served if the designers enjoy their work.
CSS artists shouldn’t need to muck around with the PHP code. Given straightforward markup with plenty of selectors, there isn’t much that can’t be accomplished with CSS and a decent browser. Even so, we’re doing all we can to make this theme’s PHP code accessible to beginning coders. Hopefully they can learn some good habits from us, if we have any!
The admin interface is going to be as simple as possible: it looks for stylesheets (*.css) in a subdirectory and lets you pick one of them. If the stylesheet has a screenshot (*.png) it will be shown. You can add stylesheets to the interface by dropping them in the folder–the theme detects them automatically and presents them as options along with a screenshot if one is present.
A small number of checkboxes may exist (just one is there now experimentally) to let you suppress the output of certain markup. The downside to adding checkboxes is that each one increases the possibility of utterly breaking a stylesheet, thereby increasing the work of the artist who wants the theme to be flexible enough (bulletproof enough). It’s enough that they have to deal with the unknown markup of posts and widgets! And we are doing this for the artists.
Actually we’re doing it for the bloggers, too.
Although I do consider myself styleblind, I did tackle the problem of creating the first complete Sandbox skin. Actually I dropped in the Kubrick stylesheet and tweaked it to work with Sandbox. It does a very nice job of emulating Kubrick, with a few improvements. The exercise gave me a chance to see the HTML in a new light and I’m still making changes based on the experience.
I’m interested to know what ideas you might have on the subject, whether you’re a coder or a CSS artist or a walrus. Oh, you want to see the HTML already? Soon. Very soon.
July 20, 2006 at 7:41 pm
It sounds like you’re cooking up something really neat.
I wonder what you’ve got in mind for the users out there who want to alter the number of columns. What I like about the Kubrick theme is its one column-ness, but even that theme has some sidebar action going on.
Of course, semantically, they’re not even “columns” or “sidebars” exactly…
July 20, 2006 at 7:50 pm
Dylan — Don’t think we’ve made another Kubrick mod. What the Sandbox aims to do is provide semantic, thoughtful markup that can accommodate practically any design and behave ‘dynamically’ with scripts and CSS without messing with markup.
Right now there are six (six?) different fluid layouts, Kubrick, and my favorite: no style. The styles don’t build on one another, but they can, and that’s very cool.
July 20, 2006 at 7:51 pm
[...] If you’re interested in reading about the next release of Minimalist Sandbox, head over to Andy’s blog to read about the semantic classes that are being generated for the body. [...]
July 21, 2006 at 2:25 am
Are you guys looking at microformats at all? You might consider also applying hAtom classes to posts and comments.
July 21, 2006 at 3:03 am
Chris: I am glad you mentioned that. hAtom is exactly the kind of idea I was looking for. Thanks!
July 21, 2006 at 9:43 am
Yes, those should integrate nicely. And the best part: easy to implement.
July 21, 2006 at 9:45 am
CSS Artists, Theme Developers, these titles just keep getting amusinger.
seriously, it does sound excellent. It’s simultaneously troubling and exciting to see one theme become this universalizable.
July 21, 2006 at 10:05 am
Very exciting indeed. I can’t wait to see what kind of designs get produced by CSS artists using the completed Minimalist Sandbox (really makes me wish I’d waited a few more weeks before switching to WP).
I think someone mentioned CSS Zen Garden in the previous post, and I hope we get to see something exactly like that: a demo site running Minimalist Sandbox, with a CSS switcher javascript link to try on different CSS skins using exactly the same semantic markup.
July 21, 2006 at 10:22 am
I am a walrus. I am not THE walrus - that was Paul. But I can speak on behalf of walruses everywhere when I say, this is just the kind of thing we’re looking for. That, and perhaps WordPress localized for Walrussian. And a keyboard that works better with EITHER tusks OR flippers - that would be good, too.
And some penguins.
July 21, 2006 at 1:53 pm
If you need some help with styling, just let me know. It is what I do, and I would be happy to help and to represent the “keeping-it-simple” league of stylesheeters…
July 21, 2006 at 2:02 pm
andreas: We’ll release some some HTML examples and docs very soon. You can start styling from there and PLEASE don’t feel the need to keep it simple for our sakes. Go wild.
July 22, 2006 at 8:51 am
[...] Ugly art is still art. Beautiful design is still design. And yes, the starting point for this was Andy Skelton’s semantically incorrect title for a post about semantics. But it’s a point that’s often missed. Usually in the form of “you wouldn’t tell picasso to redesign his paintings!” Answers will be posted as an update. [...]
July 22, 2006 at 10:30 am
“CSS artists shouldn’t need to muck around with the PHP code. Given straightforward markup with plenty of selectors, there isn’t much that can’t be accomplished with CSS and a decent browser. Even so, we’re doing all we can to make this theme’s PHP code accessible to beginning coders. Hopefully they can learn some good habits from us, if we have any!”
Joy!
July 22, 2006 at 3:07 pm
Magic tricks with PHP are fun, but sometimes you just want to make a theme that looks good and is thoughtfully marked-up—not spend an hour considering if the date should be wrapped in a
por adiv. So we’ve considerately done that for you. It’s a Sandbox. It’s your sandboxAugust 4, 2006 at 9:12 am
Any idea what CSS classes/elements need to be included if we up load a custom file?
August 4, 2006 at 11:03 am
rbonini: That is a fine question. I have a thorough readme.html file that is dying to get out there. I’ll be posting something very soon on my blog.
September 16, 2006 at 12:28 am
[...] It’s not amazing for the graphics themselves so much as for leveraging Scott and Andy’s dynamic semantic classes. As much as is reasonable, I’ve tried to use background positioning and rasterized text in place of the standard “arial or times roman or else” of most web design. [...]
November 18, 2006 at 8:58 pm
[...] WordPress versions 1.2 and below used a templating system like the one andy proposed. The problem was, the classic theme had limitations. if you wanted to remove the sidebar on post pages, as kubrick does, you were out of luck. The Sandbox would fix that. The other development that helps make templating viable again was introduced in wordpress 2.0. Since 2.0 was introduced, wordpress loads functions.php of the current theme, if it exists. this means that a theme could use only style.css and functions.php, and have an enormous level of control. [...]