Add the theme name as a body class in Drupal 8 or 9

function TEMPLATE_preprocess_html(&$variables) {
$variables['attributes']['class'][] = \Drupal::service('theme.manager')->getActiveTheme()->getName();
}

Leave a Reply

Your email address will not be published. Required fields are marked *