Themes are the part of Drupal that you, and anyone else visiting your Drupal powered application, see when they view any page in their browser. You can think of a theme as a layer, kind of like a screen, that exists between your Drupal content and the users of your site. Whenever a page is requested Drupal does the work of assembling the content to display into structured data which is then handed off to the presentation layer to determine how to visually represent the data provided.
Themes in Drupal are responsible for the look and feel of your site. They provide the HTML markup, CSS, typography, images, and interactive experience that people encounter when they view your site. Each theme is a set of files including style sheets, Twig templates, Drupal-specific YAML files, images, and more, all contained within a directory. There are hundreds of community-contributed themes available. Themes are often one of the first places you'll start to modify the code and make your Drupal site truly unique.
Developers can create new themes to customize the look and feel of a site. This can be done by either extending an existing theme and making minor changes, or creating a completely custom design.
There are three different types of themes:
- core themes: themes that are included with Drupal core and live in the /core/themes directory
- contributed themes: themes that are download from Drupal.org, and are typically placed in the /themes/contrib directory
- custom themes: themes that you or a theme developer created specifically for your use-case, and are typically placed in the /themes/custom directory
- Install a new theme
- Change the overall appearance of your Drupal site
- Modify the appearance of specific pages, or elements on a page
The basic concept of themes, how they are integrated into a Drupal site, and the role they play is unlikely to change. While it is possible to do so, there is little reason to use anything other than Twig as your theme engine.
New to theming in Drupal 8? Start with Hands-On Theming and learn to theme in 1 hour per week for 7 weeks:
Here are other good starting places:
There is a full guide to all of our Drupal 8 theming tutorials. It covers everything you need to know about using, and creating, themes in Drupal.