Creating a theme: CSS only?

no2e - January 12, 2009 - 00:23

I did not dip into theme developing yet.
I'm planning to create a custom theme for a website.
It won't be anything "special/extravagant".

At the moment I wonder, whether/when/why I should use a contributed custom theme to start my own one?

I think that I'd need to edit CSS only (nearly; I'd maybe need to hide some content with the help of .tpl files).
So to speak I could use any theme, can't I?

Or let me ask it the other way round:
In what way can contributed themes support the creation of my template? Where are the differences between all these contributed themes - beside the different CSS?

Is there a theme maybe, which "addresses" each possible CSS selector of standard Drupal features, whether it's used in the CSS or not? So that I would have to delete these selectors I don't need to use.
Because I'd love to create my CSS from scratch - I always did it that way; it's kind of hard for me to "subordinate" to another webdesigners CSS. But on the other hand, I don't want to investigate Drupals way of producing the HTML.

You know ... if I start a static website, I know what HTML I've used and can create the CSS easily. But now I've got the HTML "predefined" - and there are elements and elements combinations I can't even dream of, I bet. It's not like I have to check a few HTML pages only, because Drupal generates (dynamically) so much pages - it's no fun to find/test them all.

Zen

sunset_bill - January 12, 2009 - 02:05

The Zen theme probably gives you the most CSS control over your site. The Framework theme is bit simpler but still lets you do a lot. Both start out nice and boring and leave everything up to you. There are a few other barebones-type themes out there, but Zen and Framework are the ones I've tried.

cheers

In your case, I'd suggest custom theme or a framework theme

Keyz - January 12, 2009 - 02:26

A contributed theme, unless it is specifically one of the ones made as a framework / starting point theme, would not be good for the case you mentioned. You'll be "cooking in someone else's kitchen" so to speak, and (at least in my experience) waste a lot of time just trying to figure out and undo what was already done to the theme.

"Most" of your theme's overall HTML is not going to be generated by Drupal really... you can code the bulk of your whole theme's layout without worrying at all about Drupal. After your own template is done, you will just plug in a number of snippets of PHP in the right places (see guide, and here's a list of the available variables), and only those spots will have Drupal-generated HTML (a lot of which you can control quite easily, and a little of which you can still control but requires a bit more effort... and in almost every case will have a Class and/or ID to latch onto with your CSS, so resorting to modifying the HTML output is rarely needed). There are actually only a few templates that contain nearly everything of core's theming (except in Views, which is another matter). Properly written Drupal 6 contributed modules also provide simple tpl.php files you can copy/paste into your theme's directory, and customize as needed. Drupal core, modules, etc will likely produce some IDs/Classes you don't need, but they can exist without hurting anything (if you don't custom style them, then the core CSS files usually still take care of it for the most basic things such as keeping core's jQuery/dynamic features and the basic essentials of the admin section working).

Given what you said I would suggest either:

  1. Starting completely from scratch (no Drupal theme), designing the site "almost" like you would if Drupal were not part of the equation. I say "almost" because I suggest keeping a number of Drupal themes handy to refer to just a few key areas, such as menus, forms, etc. In some cases you will probably want to just go with the HTML output and the ID or Class Drupal gives in those cases, as it could require PHP overrides to change them. Most of the time though it doesn't matter. Just keep a theme or two open in your browser, and use Firebug to see the code of those areas (I'd recommend referring to the core or Acquia themes if possible so you know it's most likely done in a standard way, such as Garland, Acquia Marina, etc... or also refer to the core template files at example.com/modules/system). When your theme is done and installed in Drupal, as you browse the site it will become clear right away about any parts of the theme that are left unstyled (e.g. in the admin section especially)... identify those and either style them the way you want, or copy out the relevant bits from a different theme.
  2. Alternately, choose a framework theme. I haven't tried them all myself (there are quite a few more now than when I started with Drupal), though Zen is often recommended. I think Zen "could" end up still being over-complicated if you want to do things your own way (Zen isn't "the right way" necessarily, it's just "a way"). Some other framework themes I've noticed include: Advanced Theme Construction Kit, Basic, beginningW2, Clean, and Framework.

Hope this helps :)

-- David
davidnewkerk.com | absolutecross.com
View my Drupal lessons & guides

genesis is nice

webthingee - January 12, 2009 - 03:55

I have had some fun playing around with genesis and basic

 
 

Drupal is a registered trademark of Dries Buytaert.