Add custom body class in 404 page
//itr_theme.theme - hook_preprocess_html if(\Drupal::request()->query->get('_exception_statuscode') == 404) { $variables['attributes']['class'][] = 'test'; }