After reading a few posts in the Drupal forums I felt compelled to write this article to help people new to Drupal theming. Any Drupal theme can be a sub-theme and actually this is probably the preferred way of modifying a theme rather just modifying the HTML and CSS. The reason sub-theming is better is because a sub-theme will inherit the parent theme's resources. So instead of duplicating the theme files you can simply override the elements you don't want. So let's say you like a contributed theme but want to change the color scheme it's much easier (editing and maintaining) to use a sub-theme than create a one off theme.
Creating a sub-theme
- Name your sub-theme and create the theme folder
- Create an info file and define the base theme (
base theme = contribtheme)
- Add at least one new stylesheet (This will have your overrides)
- Optional: Define new regions, override template files, set advanced theme settings
Something worth noting is that a sub-theme is dependent on the parent theme. So what does this mean? If you upload only your sub-theme to your /sites/all/themes folder without also adding the parent theme your sub-theme will appear broken once you enable it. This is because without the parent the base CSS, JS, and templates are absent so the only thing that is loaded is your override files.