Image by Patrick Fore

How to style the Drupal content creation page

It worked in Drupal 7. What happened?

function SOME_MODULE_preprocess_html(&$variables) {  if (empty($variables['node_type'])) {
$route = \Drupal::routeMatch();
if (($route->getRouteName() == 'node.add') &&
($node_type = $route->getParameter('node_type'))) {
$variables['node_type'] = $node_type->id() . '-add';
}
}
}

Software developer, entrepreneur, happy mapper.