3 edited question for clarity
source | link

In D8 how could I add a body class to a node create or edit page in a custom theme?

Am thinking there should be a way of doing this via the preprocess_html function in my theme file.

Please note that I'm trying to add a class to the body of a node create or edit page, not a normal node page. This is a very specific thing I'm trying to do which is not met by any previous answers.

I'm hoping that there is some variable within the preprocess_html function that can target these pages.

In D8 how could I add a body class to a node create or edit page in a custom theme?

Am thinking there should be a way of doing this via the preprocess_html function in my theme file

In D8 how could I add a body class to a node create or edit page in a custom theme?

Am thinking there should be a way of doing this via the preprocess_html function in my theme file.

Please note that I'm trying to add a class to the body of a node create or edit page, not a normal node page. This is a very specific thing I'm trying to do which is not met by any previous answers.

I'm hoping that there is some variable within the preprocess_html function that can target these pages.

2 duplicates list edited from Adding a class to “body” to Adding a class to “body”, Simple way to add a class to the body when creating/editing an entity
| link
    Post Closed as "duplicate" by 4k4 8 of
1
source | link

Add a custom body class to node edit/create page

In D8 how could I add a body class to a node create or edit page in a custom theme?

Am thinking there should be a way of doing this via the preprocess_html function in my theme file