Move classes out of the preprocess functions and into the Twig templates. Use the addClass() attribute method to add classes in the template. Use the clean_class filter to filter class names, if necessary. Maintain all existing functionality and ensure all existing class names are still in the markup, even ones that are inherited.
See the following issues for more detailed examples:
See this change record for information about using the addClass() method:
See this change record for more information about the phase 1 process of moving class from preprocess to templates:
Preprocess Functions Modified
template_preprocess_install_page seven_preprocess_install_page template_preprocess_maintenance_page seven_preprocess_maintenance_page
Twig Templates Modified
The install and maintenance page functions pass classes to and in the html.html.twig template.
See if these need modifying:
Beta phase evaluation
|Issue category||Task because it improves the Themer Experience.|
|Issue priority||Normal because it should not affect many people.|
|Unfrozen changes||Unfrozen because it changes markup.|
|Prioritized changes||The main goal of this issue is usability of the new Twig theming layer, and since it adjusts markup it must be completed prior to RC.|
|Disruption||This issue is a prioritized change (theme improvements) as per https://www.drupal.org/core/beta-changes and it's benefits outweigh any disruption.|