Stable is now part of Drupal's deprecated and obsolete modules and themes
In Drupal 10, the Stable theme has been replaced by the new Starterkit theme generator. The Starterkit theme generator is now the recommended way to creating new themes, to be done instead of setting a theme's base theme: to core theme such as stable. Note that this is specific to creating new themes, and there is no automated tooling to convert existing themes to leverage Starterkit.
Themes depending on Stable have three options to be Drupal 10 compatible
Option 1: use the Stable contributed theme
Existing themes that use Stable as a base theme can continue to use Stable from a contributed project. It will effectively work the same but it's now a dependency on something outside of Drupal core.
Option 2: Switch the base theme to Stable 9
Stable 9 is fairly similar to Stable, but there have been changes to keep it current. It's worth reviewing these changes to ensure you do not have any regressions
- Compare the preprocess functions in
stable.theme
andstable9.theme
. If it seems like anything in stable.theme is something your theme depends on, copy those preprocess functions to your theme's.theme
file and change the function name prefix fromstable
toyourthemename
- Review the templates that are different in Stable and Stable9, and check your site anywhere you think it may result in a regression. There are additional templates that have minor differences such as comments that would not impact your site. These are the ones that could potentially have impact:
- status-report-counter.html.twig
- status-report.html.twig
- system-modules-details.html.twig
- system-modules-uninstall.html.twig
- system-themes-page.html.twig
- views-ui-views-listing-table.html.twig
- comment.html.twig
- media.html.twig
- node.html.twig
- file-link.html.twig
- datetime-wrapper.html.twig
- install-page.html.twig
- Review stylesheets that are different in Stable 9:
- block.admin.css
- normalize-fixes.css
- normalize.css (this is potentially the most impactful. You can also override it with stable's normalize.css if you'd like to avoid too many changes)
- filter.caption.css
- container-inline.module.css
- progress.module.css
- system-status-counter.css
- file.admin.css (not included in stable 9)
- filter.admin.css (not included in stable 9)
-
JavaScript differences:
-
In
user.theme.es6.js
,Drupal.theme.passwordConfirmMessage
returns different markup in Stable 9 ajax.es6.js
is not included in Stable 9. The functionality it provided should now be available without the need to provide it in Stable 9 unless a site was specifically overriding this file.
-
In
- Be aware that Stable 9 pulls images (such as icons) directly from core. Stable 9 does not contain any images of its own. This differs from Stable, which had copies of every image. None of these images have changed, so there should be no noticeable impact, but the images will be delivered from a different directory.
Option 3: Remove your theme's dependency on Stable themes altogether
Set base theme:
to false
and copy any necessary templates/css/js/libraries from Stable to your theme, and configure the necessary overrides. This is likely the most complex option, and the specific steps will be theme-dependent.
Comments
Clarifications
Is "Remove your theme's dependency on Stable themes altogether" title actually the third option? If so, it could be clearer if "Option 3:" would be prepended to the title.
Yes, seems that "Remove your
Yes, seems that "Remove your theme's dependency on Stable themes altogether" is the third option. Should be labeled like that, otherwise one might suppose it's the final step of the second option.
Updated. Thanks.
I've updated "Option 3", labeling it as such, to clarify this point. Thanks.
Note that both stable and
Note that both stable and stable 9 are hidden themes and if you remove your dependency, you must also install it, but thats not possible from the UI, so you have to use drush theme:uninstall.
🙌
woah, very helpful, thank you!
Option 1
If you go with option 1 ("use the Stable contributed theme"), it's as simple as adding the Stable contrib theme to your project -- in other words:
That's it, you don't have to "install" or change anything in Drupal or in whatever theme you're using that depends on stable: simply add it to your site, and you're all set. (If you're using Upgrade Status, refresh the page, mayyyyybe clear cache but probably not even that -- you'll see the red error in "Drupal core and hosting environment" > "Deprecated or obsolete core extensions installed" is gone.)
Composer?
The project page for contrib stable currently says you can't install it with composer.
In my tests, it seems to work if you just uncompress the tar.gz file into themes/contrib/
Issue with information in info.yml is fixed
Project page states:
Above under Option 2, it says
Above under Option 2, it says, "Compare the preprocess functions in stable.theme and stable9.theme." There is no stable9.theme file in the stable9 folder. Is that your point?
Please add this time saver
It would be a great time saver if, for the files in the "to review" sections under Option 2, the relative paths could be added. Otherwise, they can be rather difficult to find. You can safely leave off the "/templates" or "/css" parts, because each section is referring only to files in each of those folders.
For example (for "templates"): /field/file-link.html.twig
It's never too late to have a happy childhood. ;-)