The Definitive Guide to Drupal 7

Tips for Creating Your Own Base Themes

  • Don’t do too much: It’s important not to make too many assumptions in your base themes. Ask yourself if what you are doing will fit in well on any project you work on. If the answer is no or maybe, it’s likely not a feature you should include in your base theme.
  • Look at contributed themes: Looking at what other contributed themes have done is one of the best ways to learn. Chances are you’ll find some things you like and some things you don’t from each of them. Don’t be afraid to mix and match.
  • Provide styles for layout and others structural elements: Take care of things that you consistently do on each project. For example, normalize font sizes, provide CSS resets, and make sure that the general padding and margins are set so blocks and nodes are not on top of each other.
  • Use multiple CSS files: Aggregation and compression will take care of combining these files automatically, so don’t be afraid of using a few CSS files. This will allow you to easily choose between what you want and don’t want in your subthemes.

You are reading content from two chapters on Theme Development from The Definitive Guide to Drupal 7, written by Jacine Luisi and published by Apress on July 19, 2011. All rights reserved.