Get active theme in Drupal 8

if you want to get actual active theme name (administration theme included), use: 

$activeTheme = \Drupal::service('theme.manager')->getActiveTheme(); 

if you want your default front end theme, use:

$defaultThemeName = \Drupal::config('system.theme')->get('default'); 


Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.