Planning Your Drupal 8 Theme: Choosing a Base Theme

Nov 22, 2016 · by Jorge Diaz

Whenever we start a new Drupal project, we have to choose what kind of theme we're going to create. Are we going to use a framework like Bootstrap or Zurb Foundation? If so, do we start with a contrib base theme or do we implement the framework ourselves? Are we going to use a classic Drupal base theme like Zen or AdaptiveTheme? Or are we going to build the theme 'from scratch' starting with Drupal core or a core base theme? 

It's also important to plan out the priorities for the theme: how much front-end performance optimization do we need to do? Will the theme be used for internal applications, or just the public-facing website? Will the theme be re-used across multiple sites? Is the person maintaining the theme a CSS wizard or an HTML expert?

Choosing a Base Theme

Although you can change your Drupal theme at any time, doing it in the middle of a development project isn't a good idea. So you'll always want to choose the most appropriate base theme at the start of the project. Here are some things that could influence your decision:

Client's Preference

Sometimes you'll have clients who say "I want you to use the Basic theme". Maybe it's defined in their Drupal guidelines, is what they have direct experience with, or what they read about in their favourite Drupal blog. Usually, this happens when you are dealing with a technical client who specifically hired you/your company to deliver a Drupal project.

There's a learning curve for adopting a new framework, so it's also important to consider whether you or your client will be maintaining the theme when you make your selection. When the preference is not a big deal, then you are able to aim for the variant that best fits your preferred development process and your theming experience.

Updates to CSS vs. Updates to Markup

If you're building a theme based on Bootstrap or Zurb Foundation, that theme already comes with lots of classes that you can apply to your markup. That means that when you're implementing your site, you'll probably have to customize lots of templates to add those classes to new components.

On the other hand, if you're building a theme based on the core Classy theme in Drupal 8, you get very little CSS out-of-the-box. You're going to spend a lot more time writing CSS, and occasionally overriding templates when you need to add a class to style something specific. Some frameworks come with a set of SASS mixins that you can apply to your CSS selectors, so this approach also requires more CSS-writing than markup-editing.

Using a Pattern Library

Pattern libraries are all the rage! If you're developing your own patterns, then you'll probably want to go for a more minimalistic approach and stick with a core base theme, or a very simple contrib one. This will allow you to apply your own classes to components on the site, which are then themed by your pattern library styles.

The Design

With Drupal, you can theme anything from a trendy customer-facing website to a large web application. Or sometimes you're building both at the same time. 

Theming application-specific components like forms and tables can be tedious work. If this is in-scope for your project, it might push you to use a framework like Bootstrap or Zurb Foundation that will provide base styles for these components. For a purely back-end application, you could also consider Drupal's many administrative themes, including Adminimal and Ember.

Performance

When it comes to performance, less is better. The fastest procedure ever is the one that doesn't happen. Depending on your theme, you'll have different settings, functions, JS libraries, and template overrides that could slow down your site.

A theme based on Drupal core will probably be lighter than one based on a contrib base theme that loads a lot of default CSS and Javascript libraries out-of-the-box. Theme settings can also affect performance, so testing how various settings affect the front-end performance of your site is a best practice.

Conclusions

There's no specific answer to the question 'Which base theme should I use?' It always depends on your use case, your client, and future plans for the project in question. While it's important to choose a base theme that fits with your needs, remember that many different theming approaches can be used to accomplish the same goal.

If you are interested, you can read more of my blog posts about Drupal theming and if you want to connect with me, I invite you to follow me on Twitter.

Here are a few links you may find interesting if you are a Drupal Themer:

Jorge Diaz

About the author, Jorge Diaz

Jorge is an Acquia Certified Grand Master Developer and has been working as a Drupal front-end developer & themer at Evolving Web since May, 2015. He has more than 8 years of experience delivering Drupal-based solutions across a wide range of industries.

More Articles by Jorge Diaz »
Sign up for our training newsletter

Receive occasional email notifications about upcoming training courses near you.

Featured Articles