Why We Advise Against Most Starter and Base Themes

I recently gave a presentation about performance and scalability at one of our local Drupal meetups here in Shanghai, an got confronted with questions on Drupal theming and more particularly the type of starter theme we use here at Wiredcraft. Well, the answer is quite simple; basically, we don't, at least not the major ones. No Zen, Omega or Fusion, no custom base theme either or CSS framework such as 960 Grid. What we do systematically use though is Tao; let me explain...
Why don't we use starter themes?
I believe that starter themes can be interesting in a couple cases;
- It can help beginners get started with Drupal theming by setting up a lot of defaults for a somewhat overwhelming number of elements you need to get familiar with.
- It can provide administrators with a quick way of adjusting layouts; combining Panels and the 960 Grid (using the NineSixty theme) can be an interesting approach, allowing for easily adjusting the layout by simply assigning classes to panes. However, while they may prove useful through the designing and prototyping phases, grid frameworks create semantic issues and can be very rigid to deal with. Moreover we never, ever use Panels; we're Context guys and have been from the very beginning.
The problem is, we think that for experienced Drupal developers there are quite a few drawbacks to these starter/base themes;
- They tend to slow down developments by adding another layer of complexity; additional APIs, functions, "hooks"... I can't remember the number of times I struggled with a very straightforward preprocess or theme override in a theme because Zen was adding some "helper" functions around things.
- They often introduce bugs or incompatibility with some other modules (Zen with Context for example) as well as performance concerns. All that sugar-coating has an overhead that can be very costly; we quite regularly do performance audits of Drupal sites and haven often advised for a complete rewrite of the theme.
- Our opinion is that more often that not they lead to poor practices (or at least enable them), the biggest one being the proliferation of template files and CSS spreadsheets, instead of relying on preprocessing and properly thought through layout and styles. How many times have you open a custom theme folder to find an insane amount of
views-view--XXX-block.tplfiles?
We're suckers for Tao!
We have been using Tao as a base theme since the end of 2009. I am unsure as to why, but many people either don't really acknowledge its existence as a full blown base theme, or don't really understand what it does. Maybe this has to do with it having been hosted on Github in its infancy, or the fact that it was mainly built as a dependency of Rubik (an admin theme that we've shipped with all our sites since its first release, give it a go...).
What Tao does really, is dealing with the bulk of the issues anybody has with Drupal theming. Let me paraphrase the project page here to list what it does (well);
- Resets browser and Drupal core default styles (die admin.css),
- Unifies the template family into a consistent format (node.tpl.php, block.tpl.php...)
- Various other small fixes and bonuses, such as a proper print stylesheet or theme overrides for fieldset and pagers.
In brief, it gives you a solid, clean foundation both in terms of CSS and HTML to build a theme upon.; if you stick to it and leverage the power of preprocessing functions, you should be able to build leaner and more robust Drupal themes. We strongly advise anybody doing Drupal theming to give it a try; we've already converted quite a few clients and partners to it.
But...
This approach has been really rewarding for us in the past couple years, the only thing is that it does require you apply the same type of concepts to your design approach; we believe that building lean, simple, information oriented interfaces is the way to go, and if you do so, your graphical concepts should translate properly with a Tao based approach. But that's a whole other discussion.
Comments
That could be a concern, however the very fact that Tao is simple and straight to the point makes it that there will be probably few releases. Moreover, Phase 2 took over Open Atrium and Managing News a mere few months ago and is still probably working through getting up to speed with maintaining the sheer amount of pieces that made it (which includes Tao, but also Features, Context, Feeds, Strongarm...). Give them a bit of time and they will probably get things moving.
Performance is not my main concern here; caching is always an option (or a default in that case), however maintainability suffers from the multiplication of template files.
Well, that's again a point of view. I can see how relying on the preprocessing approach can be daunting from a Web designer/themer point of view; Drupal theming has always been a bit geekier than, say, Wordpress, but I actually don't agree with some people who think that it makes it inferior. Preprocessing and override mechanisms can be your best weapon and these are definitely not to be limited to modules; the theme of this very site is based on Tao and uses only 1 template override (to change the place Drupal messages are displayed) and 10 (small) preprocessing functions in
template.php.I hope to publish a follow up some time next week.
I don't doubt that some people get to leverage some of the advantages of the base/starter themes I mentioned, I am merely stating that for people knowing their way around preprocessing and theming overrides and willing to put a certain structure in the design process, Tao can be an tremendously efficient tool by its simplicity. When it comes to benchmarking and further demonstration of use, I well intend to expose things in two future posts, but rest assured that this come from experience and not gut feeling, working with our clients; CNN, the UN, Axel Springer and Popcap Games to name a few.
I beg to differ; I fail to see how this tone is supposed to be FUD. We honestly advise our clients against these base themes for, mostly, the reasons I mentioned in my post. You may see some of our points as generalization, because that is somehow what I was trying to outline; the higher perspective on why we approach things with a lightweight base theme like Tao. These points are backed up by personal experience over the course of several years of Drupal related development; some people successfully use Zen, the same way that some people use Panels (instead of Context), SVN (instead of Git) or chose to ignore tools such as Features, Strongarm, drush make and instlal profiles... I am fine with people having a different approach, the bottom line is that it does not work for us and I'm merely exposing my point of view on things.
- resets browser and Drupal core
- eliminates admin.css with the click of a checkbox (can also disable 20+ other stylesheets if you wish)
- makes proper use of preprocess functions
- Omega/Delta uses Contexts
I've also never had a need to touch an Omega 3.x tpl.php file. The only thing I see here that Omega does not yet offer is a print stylesheet. It also offers many other features such as HTML5, flexible grid, custom grid based layouts, debugging tools, and toggling of elemets such as Messages, Action links, Tabs, Breadcrumb, Page title, Feed icons. Sorry to sound like an advertisement for Omega, I'm just a loyal user, and think the criticisms of base themes in this article are not applicable to Omega.I can see your point regarding the Omega theme, we may not have made justice to it by bundling it along with Zen, Fusion and the likes. Tao however has been around for a good little while and is, as I said, pretty much straight to the point. I don't intend to necessarily systematically blame Omega for introducing performance or compatibility issues as such, just that the overall approach of relying on a fairly large(r) code base for building your theme is not something we favor based on our experience.
I don't fully agree; from my own experience, most of big security gaps come from things that happen in the templates files directly, things like displaying node fields straight from the node object in a tpl file, short-circuiting any type of filtering that Drupal is supposed to do. Stick to preprocessing and you should be fine; that's exactly what we do with Tao as a base theme.
Alright, the headline may be slightly tangential, but the introduction addresses that (IMO): "at least not the major ones. No Zen, Omega or Fusion, no custom base theme either or CSS framework such as 960 Grid".
I am not entirely sure of what you mean when you say "and the user needs to adjust them", but I would recommend you have a look at Context and Tao working together; you have the ability of defining classes that are caught up in Tao as well as defining contextual layouts. We've been using it on a couple sites and hope to describe more in details this, and other details related to Tao, in a post next week.
I've used SASS and LESS a couple times for some experimentations of mine; I've never used them on a professional site though. I like the idea, a lot, the same way I like CoffeeScript, I've just never seemed to find a really compelling reason to switch to it though.