Building a theme with FortyTwo

The FortyTwo theme is designed to be extended by a sub-theme. You shouldn't modify the any of the CSS or PHP files in the fortytwo/ folder; instead create a sub-theme which is located out side of the root fortytwo/ folder.

We tried to make the base theme as clean and simple as possible. It has some styling for basic input fields and buttons.

Including Part Template

Many themers prefer to keep header / footer codes in a separate file and call the file in page.html.twig

Let's say you have created following file in your theme folder for header.

And now you want to include this file in page.html.twig

Use below code to include this file.

{% include directory ~ '/includes/header.html.twig' %}

Classy themes css selectors

Document all css class selectors that are in the classy theme Drupal8 RC 2


.foo { }
.foo-bar { }

filename.html.twig / filename.css

Twig - Available CSS selectors in the Classy theme:



.user-logged-in { }
.path-frontpage { }
.path-[root_path] { }
.node--type-[node_type] { }
.db-offline { }
.visually-hidden { }
.focusable { }
.skip-link { }

file: html.html.twig

Theming in Paragraphs for Drupal 7


The default paragraphs template is in paragraphs-item.tpl.php.
It uses theme suggestions for other templates, the following suggestions are available:

Using attributes in templates

Documentation of the Attribute object that appears in many html.twig templates.


Subscribe with RSS Subscribe to RSS - theming