Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We have moved classes from preprocess to templates here #2322163: [meta] Consensus Banana Phase 1, move CSS classes from preprocess to twig templates.. I think it would be good idea to keep heading towards the same target; having as many classes defined in the templates as possible. Place where I think we have most of the classes coming outside of template is render elements.
Proposed resolution
Move classes from render elements to templates. Other attributes can stay in the render elements and are not being touched by this issue.
Comments
Comment #2
lauriiiComment #3
star-szrOff by one error on the component?
In general +1 to this. We may want to think about introducing theme_context to do this properly - to still pass relevant info to the templates.
Comment #4
davidhernandezWe'll likely need to add them back in Stable using preprocess for BC, but otherwise this seems fine.
Comment #9
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commented