Using Themes in Drupal 8

dr

The visual layout and presentation of your new Drupal site is defined through a Drupal component called a theme. A theme defines
-The colors used on the page.
-The fonts used for text, headings, links, and other elements.
-The placement of images and graphics that are present on every page of the site (images and graphics that are associated with the page itself rather than a content item).
-The layout of the page (such as a menu at the top, a banner area, a secondary menu below the banner, a column on the left, or a footer).

Themes can be as simple as a plain white canvas or as complex and visually energizing as your imagination can conjure up. Drupal themes are designed and developed using HTML, cascading style sheets (CSS), and elements such as variables, expressions, and tags from the Twig templating engine. Twig makes it easier for nondevelopers to create Drupal themes because they don’t have to know PHP, the programming language that Drupal is built upon. Most Drupal developers use custom themes, but also out-of-the-box themes.

We have already worked with a Drupal theme; the basic Drupal 8 site that we installed as part of the earlier chapters in this book uses the default Bartik theme. Bartik is a predominantly “black and blue” theme, with a relatively simple structure. The theme provides 17 different regions where you can place content, widgets, images, videos, forms, or other elements.

You’ll find as you browse through various Drupal themes that many of them follow this same generic layout, which for many people is a negative because it makes them believe that every Drupal site looks nearly identical. The truth of the matter is that, yes, many off-the-shelf themes follow this same layout pattern. However, you have the ability to create a layout that significantly deviates from the standard.