Chapter 2. Responsive, Meet Drupal
So this responsive web design stuff is all fine and good, but isn’t this book supposed to be about Drupal? Well, you want Drupal, and Drupal you shall have. Let’s talk about adding responsiveness to a Drupal 7 theme.
A Bit of A Primer on Drupal Theming
Before we get too deep into the weeds on making Drupal responsive, let’s back up a bit and talk about Drupal theming in general to make sure we’re all on the same page. To start, you should be familiar with the following terms:
Drupal’s command-line interface. It gives you commands for doing things like clearing cache, updating modules and themes, running arbitrary PHP within the context of a fully bootstrapped Drupal, syncing databases and files between environments, and much much more. It’s basically a must-have for any and all Drupal developers at this point.
Used as the basis for subthemes, these provide a lot of commonly used theming functionality to be inherited, extended, and altered for your use.
Custom-built themes that inherit from base themes. For example, if you use the Zen base theme, you could build a subtheme that lists Zen as its base theme, telling Drupal to load everything in Zen first and then load everything in your subtheme, some of which might alter or override the Zen defaults.
Moving on from there, you need to understand the basic anatomy of a Drupal theme. There are a few common files you’ll find in just about any Drupal theme: