By bramdriesen on
Change record status:
Draft (View all draft change records)
Project:
Introduced in branch:
9.5.x-dev
Issue links:
Description:
A new template variable is_admin_route has been added to template_preprocess_html() making it available to all html.html.twig templates. All core themes are using this variable to add a is-admin-route class to the body tag. The toolbar module's CSS uses this to identify admin pages through css and to show the "back to site" button.
Any custom or contrib theme that overrides html.html.twig is encouraged to add the class to the body tag.
Example usage (twig):
{%
set body_classes = [
is_admin_route ? 'is-admin-route',
]
%}
<body{{ attributes.addClass(body_classes) }}>
Impacts:
Themers