Drupal 10 Will Change How You Create Themes With New Starter Kit

Drupal has been providing subtheme capabilities for over a decade. When you create a theme for Drupal 8 or 9, a best practice is to subtheme the core Classy theme, so you get common CSS classes and the usual markup for a Drupal site. This means the Classy theme is used in the runtime as part of your theme. As a consequence, Classy has not been receiving updates since Drupal 8.0.0, because most changes are not possible while retaining backward compatibility. Backward compatibility is needed because design requirements of themes depending on Classy could depend on markup and/or CSS provided by Classy.

To solve this problem, the Drupal team is working on a new custom theme creation process and a base theme to replace Classy in Drupal 10. 

The new starter kit theme Drupal theme is working on is not going to serve as a base theme to be subtheme, but rather a theme to be copied on a new theme’s creation. It will allow front-end developers to get a copy as a starting point for their theme. Tooling is provided as part of the included Drupal command-line interface for automating this:

php core/scripts/drupal generate-theme mytheme

It’s believed and I concur that this new process will serve front-end developers better because it will allow us to provide more frequent updates to the default markup and CSS shipped as part of Drupal core.

Of course, subtheme as a concept will continue to exist even after this change. This is valuable in particular in cases where themes are inheriting design and ideas from the base theme. For example, a university could have a base theme that provides design concepts and basic layouts to all of its departments. That base theme could be generated using the starter kit theme.

Starter kit theme will serve a majority of use cases better because most custom themes are based on bespoke designs that aren’t a good fit for opinionated subtheme. Since fully custom themes customize many aspects of the theme, it is difficult for the base theme to ship improvements to the subtheme without risking regressions in the subthemes.

It’s always good to have a choice so this is a great addition to Drupal.

Related Posts