Screenshot of the Monument Valley end screen

Week 5

I've been working on extracting our Code Enigma theme from our site so that it can be composer installable. The benefits of doing this are:

  • we can open source our theme
  • we can use our theme across our different platforms
  • we avoid copy/paste copies of our theme (and the maintenance overhead that comes with that)

We have been using Pattern Lab but we're wanting to remove it so one of the first steps I took was to copy the pattern lab templates into our Drupal theme (they're essentially Twig templates, so that was straightforward).

Next, I had to replace all of the include and embed tags that included templates from pattern lab, so

{% include "@basics/images/logo/logo.twig" %}

would need to be changes to

{% include "@ce/includes/logo.html.twig" %}

Thankfully, the following regex turned up all the tags I'd need to change:


And once I'd got going, adding a negative lookahead to the regex filtered out those occurrences I had already fixed


There's still much to do, but I'll post a link to our Github repository when we push it up.

In other news, I completed Monument Valley by Ustwo games.

More from the developer cabin

A photo of Code Enigma developer, Chris.

Written by

Chris Maiden

Web Developer