Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
In my theme the StatusMessages element is rendered without the class message--status.
Looking for the source of the problem I find in status-messages.html.twig this line
@see template_preprocess_status_messages()
which is exactly where I would like to look
however that function doesn't exist in d8.
So saying, I can't see any clues in \Drupal\Core\Render\Element\StatusMessages either
Comments
Comment #1
matslats CreditAttribution: matslats as a volunteer commentedActually I think this is more serious.
In classy/templates/misc/status messages, which is also used in Bartik the classes are added by twig thus:
yet the css for these classes is in the system module.
Surely then these classes should be added by \Drupal\core\Render\Element\StatusMessages?
Comment #2
dawehnerI think the templates are the right place to add them so its as easy as possible to manipulate them in your own template.
Comment #3
matslats CreditAttribution: matslats as a volunteer commentedI disagree that these classes belong in the theme layer.
And I disagree that this is fixed.
In any case, the css is in the system module's css, and the classes are added by twig in the classy theme, so something needs to be changed, in my opinion!
Comment #4
bill richardson CreditAttribution: bill richardson as a volunteer commentedSee issue 2489460 - to move module css to classy.
Comment #5
matslats CreditAttribution: matslats as a volunteer commentedOK now all that css has been moved to classy, the system message block has no class indicating whether it is status, warning or error.
SO I still have to include status-messages.html.twig in my theme to distinguish between them!