Adding body classes to a template that inherits

I’m making a theme that inherits from antimatter, and the templates inherit from base.html.twig.

I’d my template “has-header” to add classes to the element, as if all pages using that template also defined “body_classes” in their yaml frontmatter.

Is there a nice way to do this without duplication? Apologies for such a simple question!

you would have to override the templates/partials/base.html.twig in your template to add that logic to the <body> element.

Is there a variable “page.template”? Would I write something along the lines of:

(oh! the answer is literally yes. Thanks for all your help, you’re fantastic)