Using a Drupal Base Theme for Responsive Design

drupal resposnive themeWe see that using a Drupal base theme is productive and most Drupal developers consider it a common practice. It’s very useful in responsive design. It spears you the trouble of designing a theme from scratch and provides you with several important advantages.

But let’s see now how the code looks. After all, this is what developers looking into Drupal responsive design are interested in. Remember that every theme, base theme or custom subtheme, has a .info file that holds metadata about it (metadata refers to name, description, and so on). You can tell Drupal from this file if your custom theme has a base theme, and if so, what that theme is.

Also, a subtheme that inherits from the base theme can have a .info file that features the following:

name = Yourtheme
description = Super-duper awesome thematic action.
version = 1.0
core = 7.x
engine = phptemplate
base theme = zen
stylesheets[all][] = style.css
stylesheets[print][] = print.css

The important line is the one that starts with base theme. This line suffices to tell Drupal that your custom theme inherits from the ‘Zen’ base theme. The subtheme named ‘ yourtheme’  with only one file named yourtheme.info, and listed Zen as the base theme in that file inherits all of Zen although it has no code of its own.

All you need to do is to include in your subtheme the customizations, the things you’re overriding and the additions. And you’re done.