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.
There is a full guide for learning to Work with Drupal Themes and Front-end. The main, starting component of that guide is the extensive Drupal 8 Theming Guide that covers everything you need to know about using, and creating, themes in Drupal. Here are some good starting places:
- What Is a Theme?
- A broad overview of what Drupal themes are and the role they play in a Drupal application.
- Install and Uninstall Themes
- Learn how to install and enable a theme, whether downloaded from Drupal.org or a custom theme you created
- Theme Inheritance with Base Themes
- Learn how Drupal themes use inheritance to keep work to a minimum and provide additional flexibility
- What Are Template Files
- Template files are the basis for all markup in Drupal. Learn about what they are and how they work
- Twig in Drupal
- Learn about the template language that Drupal uses for dynamic content in template files
- Layouts topic
- There are many ways to change the look and layout of your site other than with the theme. It's a good idea to know what these tools are and how they may work with a new theme.