Deprecate base theme fallback to Stable

Created on 3 July 2019, over 5 years ago
Updated 20 October 2023, about 1 year ago

Problem/Motivation

If a theme hasn't provided base theme setting, the theme will currently fallback to extending stable. This works when there's only one version of stable. However, in Drupal 9, there will be multiple stable versions (Drupal 8 stable aka stable and Drupal 9 stable aka stable9).

When Drupal 9 ships, we can choose to either either:

  1. move Drupal 8's Stable (stable) to contrib and a new Stable theme (stable9) to core
  2. keep Drupal 8's Stable (stable) in core and add a new Stable theme (stable9 to core

This decision doesn't need to be made in this issue.

In either scenario, themes must explicitly define which version of the Stable theme it wants to extend, by specifying either base theme: stable or base theme: stable9.

this solution will also work for Drupal 10! 🥳
we could choose to alias stable to stable8 for consistency. But this would merely be a cosmetic nice-to-have.

Proposed resolution

Deprecate the option to omit the base theme property in theme *.info.yml files. Provide warning for themes that haven't configured their base theme and provide them with instructions that if they want their theme behavior remain the same in Drupal 9, they would have to add base theme: stable.

In Drupal 9, the base theme property will be required.

Remaining tasks

  • See #6 + #7.
  • Agree on naming: does Drupal 8's "Stable" theme keep the stable name or do we add stable8 as an alias, for consistency with future Drupal versions' stable9, stable10, et cetera?
  • See #38 (complicated update to BaseThemeDefaultDeprecationTest) + #41 (removes BaseThemeDefaultDeprecationTest)
  • Decide whether we want to extract "app root"-related changes to a separate issue — see #40. That'd make this patch more tightly scoped.
  • RTBC.
  • Commit.

User interface changes

None.

API changes

base theme is no longer an optional property in a theme *.info.yml file. Change record: https://www.drupal.org/node/3066038

Data model changes

None.

Release notes snippet

In Drupal 8, if a theme does not specify a base them, Stable is chosen as the base theme automatically. Starting with Drupal 9, a new stable base theme will be added to each major version with the latest markup from modules, and the old stable base theme will be deprecated. To facilitate this and avoid unintended regressions, the automatic fallback is deprecated and the base theme property will be required starting with Drupal 9.0.0. To remain compatible with Drupal 9, themes that use Stable as their base theme should explicitly add this to their info files. See the change record on requiring the base theme property for examples.

📌 Task
Status

Fixed

Version

8.8 ⚰️

Component
Theme 

Last updated about 1 hour ago

Created by

🇫🇮Finland lauriii Finland

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇩🇰Denmark ressa Copenhagen

    Will Drupal 11 also use stable9, as Drupal 10 does currently? Or will there eventually be stable11 for Drupal 11, stable12 for Drupal 12, etc.?

Production build 0.71.5 2024