Problem/Motivation

As I understand it, Admin theme is basically a copy of Gin and Gin had issues with subthemeing (or it wasn't supported at all). Anecdotally, when trying to subtheme Gin the whole site looks broken.

Subthemeing an admin theme is useful for a lot of things - e.g writing theme specific hooks, adding custom styles, extending libraries, etc. Doing this in a module can be problematic since hooks will fire in both admin and frontend themes and it becomes cumbersome to override templates just for the admin theme.

This ticket is intended to try to make a plan to unlock this.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

acbramley created an issue.

jurgenhaas’s picture

Sub-theming isn't supported, but I'm lacking a link to the source of that information. I'll investigate.

mstrelan’s picture

jurgenhaas’s picture

@mstrelan that's for Gin where we had the choice to decide that in contrib space. In core, this needs a more formal decision, though.

dww’s picture

Huge +1 for this. I almost always need to make a sub-theme of whatever the default admin theme is while I'm building a site, since me + site owners pretty much need at least some customization of the defaults (often just CSS, sometimes also Twig + preprocess, etc).

I can do the twig + preprocess via a custom module, although it's a bit more clumsy in a module instead of a theme (have to manually put all the templates in hook_theme_registry_alter() that I want to override, etc). And if I want it only for the admin theme, that’s even more clumsy.

One of the foundational tenants of Drupal core is that it’s easy and clean to extend and customize. If we’re moving towards a single admin theme, and going to be removing the UI to swap it, I consider it’d be a critical bug that the admin theme we’re shipping doesn’t support being sub-theme’ed to allow site-specific customization.

dww’s picture

P.s. I’m less interested in trying to support an entire contrib ecosystem of subthemes of default_admin. But custom site-specific subthemes seems absolutely essential to allow.