Problem/Motivation

During the Drupal 8 life cycle, we have been unable to make improvements to Classy because of backwards compatibility concerns.

When talking with members of the frontend community, many people recognize themselves in a situation where they are using Classy, but they've ended up overriding most if not all templates.

Proposed resolution

Replace Classy with a new starter kit theme. The starter kit markup and CSS will be allowed to change over time since it acts only as a starting point for themes.

This comes with a downside of not being able to provide security fixes or bug fixes for themes built using this approach. We believe it isn't big of a change from the status quo since 1) most themes override a large number of templates and 2) this is already commonly used pattern in the contrib space. The theme could be generated by running ./core/scripts/drupal create-theme command.

Remaining tasks

Beta requirements

Stable requirements

  • Identify and update existing handbook documentation that refers to Classy/Stable and related best practices
  • Write documentation on comparing versions of Starterkit themes

Post-stable requirements

Nice to have

Done

User interface changes

API changes

Data model changes

Release notes snippet

The starterkit theme generator has been in the works for a while. It became stable in Drupal 9.5.0 and will be replacing Classy in Drupal 10.0.0. Read blog post for more information about the starterkit theme generator.

Comments

lauriii created an issue. See original summary.

lauriii’s picture

lauriii’s picture

Issue summary: View changes
davidhernandez’s picture

What do we do with current Classy? do we move it to contrib? Does it need its name changed? If we remove it from core it seems the name could stay the same and avoid conflict.

catch’s picture

So the main issue is that if there's a security issue specific to the starterkit, we'd need to provide instructions on how to apply the fix to themes based on it in security announcements?

This seems like a reasonable trade-off to me, have we actually had any security issue specific to classy during the 8.x cycle at all? Usually it's lower level than the actual templates anyway.

lauriii’s picture

So the main issue is that if there's a security issue specific to the starterkit, we'd need to provide instructions on how to apply the fix to themes based on it in security announcements?

This is the biggest downside of this change. At first it might seem like a big compromise, but in my opinion, it might not be as big of a problem as it might seem like since shipping security fixes in templates already run a risk of not ending up protecting production sites, and having security fixes changing templates is very rare.

This seems like a reasonable trade-off to me, have we actually had any security issue specific to classy during the 8.x cycle at all? Usually it's lower level than the actual templates anyway.

I checked from Git history if there are any commits modifying Twig templates that would contain 'SA-' in the message, and I didn't find any. I agree that usually, it would be lower level than template, but in theory, it would be possible to have a security advisory that requires a change in a template.

lauriii’s picture

What do we do with current Classy? do we move it to contrib? Does it need its name changed? If we remove it from core it seems the name could stay the same and avoid conflict.

The proposal is to move Classy to contrib so that it's not in Drupal 9. I don't think the name needs to be changed since it gets removed from core. This is different from #3050374: Create Drupal 9 stable theme since ideally, the contrib Drupal 8 Stable theme would use the core Drupal 9 as its base theme.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

chi’s picture

Classy is a base theme for lots of custom and contrib themes. Moving it out of core will break those. Also Classy is widely used in core and contrib tests.

Can we first deprecate it, make it hidden and then remove in Drupal 10?
Edit: Classy is already hidden in Drupal 8.

chi’s picture

One more concern. Front-end developers tend to have own starter kits with SASS/PostCSS. As long as Classy is a "pure CSS" theme it cannot compete with their solutions.

batkor’s picture

subscribe

lauriii’s picture

Classy is a base theme for lots of custom and contrib themes. Moving it out of core will break those. Also Classy is widely used in core and contrib tests.

Can we first deprecate it, make it hidden and then remove in Drupal 10?

I agree that we want to first deprecate Classy and then remove it in the following major release which would likely be Drupal 10. 👍

We've been taking steps to slowly make our infrastructure less dependent on Classy by making tests responsible for selecting their default testing theme #2352949: Deprecate using Classy as the default theme for the 'testing' profile. The next step is to make core tests not depend on Classy anymore.

One more concern. Front-end developers tend to have own starter kits with SASS/PostCSS. As long as Classy is a "pure CSS" theme it cannot compete with their solutions.

Drupal core has a dependency on PostCSS already: #3060153: Use PostCSS in core, initially only for Claro. Theoretically, it would be possible to make the starterkit use this as well if that's what we want. I don't believe this would completely remove the need for contrib starterkits even though this would provide a much better experience to people who are using Classy at the moment.

chi’s picture

A quote from #3050384: Provide a starterkit theme in core.

all templates are copied to the new theme, rather than them being loaded run time from a base theme

Having all core templates in a custom theme would be a step back.
With the current approach it is quite easy to figure out what templates have been overridden in a custom theme because the theme only keeps templates that were changed.

What if instead of Starter Kit we generate a new base theme using Classy as a template? That theme should live inside /themes not in /core/themes so that it'll never be updated with Drupal core.

I am wondering if the new Scaffold Composer plugin can help on this.
https://www.drupal.org/node/3041017

davidhernandez’s picture

I don't understand how it would be a step back. The starterkit's intention is to remove the reliance on Classy as a base theme. It wouldn't be the only way to make a theme. If you don't want the collection of templates, you can still make a theme from scratch and inherit from core.

chi’s picture

@davidhernandez Right now I have classes and markup that I need (thanks to Classy) without keeping the collection of all core templates in my theme. That will not be possible when we implement this proposal.

andypost’s picture

Moreover it will bring more maintenance costs to custom themes to upgrade each template to new core's starterkit!
And more errors in upgrade if you forget to upgrade or copy new templates which is real "step back" in terms of dx/ux (which makes D harder to use for newcomers)

chi’s picture

@andypost I think they don't have to upgrade unless some security issue in the starter kit happens.

xjm’s picture

Version: 8.9.x-dev » 9.1.x-dev

Targeting this against 9.1.x since it's a new feature. 🎉

davidhernandez’s picture

You don't need to upgrade anything from the starter kit. That is the point of it copying all the templates. So your theme can stay static from the time it was created, if you wish.

dww’s picture

Is this the appropriate top-level plan issue to add a dependency on #3083275: [meta] Update tests that rely on Classy to not rely on it anymore? We can't remove Classy from core while core's tests are still relying on classy-specific markup for assertions.

dww’s picture

Issue summary: View changes

Adding #3083275: [meta] Update tests that rely on Classy to not rely on it anymore as a child issue and remaining task before we can remove classy.

dww’s picture

Issue summary: View changes

@bnjmnm opened #3110137: Remove Classy from core as a distinct step in this process, so I added that as a child of this, and am hereby adding it as a remaining task here.

Cheers,
-Derek

xjm’s picture

Priority: Normal » Major

 

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

gábor hojtsy’s picture

Issue summary: View changes

@laurii presented about this at DrupalCon Global:

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

andypost’s picture

Added as child #3206219: Allow configuring which theme is used as a starterkit theme

because contrib theme creators should be able to extend generator

andypost’s picture

Issue summary: View changes

sorted active issues to top

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii’s picture

Issue summary: View changes
xjm’s picture

Title: Replace Classy with a starterkit theme » [meta] Replace Classy with a starterkit theme

 

xjm’s picture

Issue summary: View changes

Sorting the requirements into beta, stable, and post-stable steps, and adding a few items that were in our backlog but that don't have issues yet.

xjm’s picture

Issue summary: View changes

 

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

lauriii’s picture

Issue summary: View changes
bnjmnm’s picture

Issue summary: View changes
lauriii’s picture

Issue summary: View changes

Added draft release note and a draft CR.

spokje’s picture

Issue summary: View changes

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

xjm’s picture

I think we can probably mark this fixed now, and leave the remaining issues from the two metas to proceed on their own? (Since we moved the test technical debt from being tied to Classy to being tied to Starterkit itself.)

xjm’s picture

Status: Active » Fixed

Doing that, and crediting the folks who helped maintain the meta. Thanks everyone! 🎉

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.