Starterkit Theme

Drupal 9.5+ includes a starterkit theme and script to generate your own.

The script will copy the starterkit theme and rename it to what you specify.

php core/scripts/drupal generate-theme NEW_THEME

Core Themes

Stable9

Stable9 theme exists to provide a stable copy of core templates so that sub themes can be built without breaking changes when core templates are adjusted. Usually these are small improvements that you may have already addressed in your theme.

https://git.drupalcode.org/project/drupal/-/tree/11.x/core/themes/stable9?ref_type=heads

Library Overrides

Stable9 has a collection of all core templates and libraries.

The templates are overridden with the copies in /templates.

Libraries are overridden in stable9.info.yml, see how that works here:
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/themes/stable9/stable9.info.yml?ref_type=heads

Overriding libraries in a sub theme that have already been overridden by their parent can be tricky.

https://www.drupal.org/project/drupal/issues/2829372

https://www.drupal.org/project/drupal/issues/2642122

https://www.drupal.org/project/drupal/issues/2856499

Classy

Classy provided templates with lots of classes you could use to style with CSS. This worked great when the bulk of front end work happened in CSS, but front end devs want more control over the HTML.

Classy was moved to contrib in Drupal 10. https://www.drupal.org/project/classy

Stark

https://git.drupalcode.org/project/drupal/-/tree/11.x/core/themes/stark?ref_type=heads

An almost empty theme, with nothing more than a logo, screenshot, breakpoints, and config schema.

This is used for testing and debugging. If something is broken on your site, you can switch to Start to see if it's your theme causing the problem.

If you run drush gen theme or manually create one yourself, you are essentially starting with stark.

Stark has base theme: false in stark.info.yml, which will use core libraries and templates and receive any changes.

Starterkit

Starterkit still uses a Stable9 as the base theme, but provides some customized templates and starter CSS to set you up with some helpful styles and utilities.

https://git.drupalcode.org/project/drupal/-/tree/11.x/core/themes/starterkit_theme?ref_type=heads

Templates

Starterkit has a lot of the same templates as Stable9, but there are some differences.

$ diff stable9/templates/ starterkit_theme/templates/

Only in stable9/templates/: admin
Only in stable9/templates/: announcements_feed
Common subdirectories: stable9/templates/block and starterkit_theme/templates/block
Common subdirectories: stable9/templates/content and starterkit_theme/templates/content
Common subdirectories: stable9/templates/content-edit and starterkit_theme/templates/content-edit
Common subdirectories: stable9/templates/dataset and starterkit_theme/templates/dataset
Common subdirectories: stable9/templates/field and starterkit_theme/templates/field
Common subdirectories: stable9/templates/form and starterkit_theme/templates/form
Common subdirectories: stable9/templates/layout and starterkit_theme/templates/layout
Only in stable9/templates/: media-library
Only in starterkit_theme/templates/: misc
Common subdirectories: stable9/templates/navigation and starterkit_theme/templates/navigation
Common subdirectories: stable9/templates/user and starterkit_theme/templates/user
Common subdirectories: stable9/templates/views and starterkit_theme/templates/views

Here's an example of starterkit's extra classes in the menu template. 

$ diff stable9/templates/navigation/menu.html.twig starterkit_theme/templates/navigation/menu.html.twig
 
33c33
<       <ul{{ attributes }}>
---
>       <ul{{ attributes.addClass('menu') }}>
35c35
<       <ul>
---
>       <ul class="menu">
38c38,46
<       <li{{ item.attributes }}>
---
>       {%
>         set classes = [
>           'menu-item',
>           item.is_expanded ? 'menu-item--expanded',
>           item.is_collapsed ? 'menu-item--collapsed',
>           item.in_active_trail ? 'menu-item--active-trail',
>         ]
>       %}
>       <li{{ item.attributes.addClass(classes) }}>

Fixes

Theme file contains a fix for image widget access.
https://git.drupalcode.org/project/drupal/-/blob/11.x/core/themes/starterkit_theme/starterkit_theme.theme?ref_type=heads

Tags
Theming