You are here

function admin_css_page_attachments in Admin CSS 8

Implements hook_page_attachments().

File

./admin_css.module, line 11
Hook implementations for the Admin CSS module.

Code

function admin_css_page_attachments(array &$page) {
  $theme = \Drupal::theme()
    ->getActiveTheme()
    ->getName();
  $def_theme = Drupal::config('system.theme')
    ->get('default');
  if ($def_theme === $theme) {
    if (file_exists('public://admin-style.css')) {
      $page['#attached']['library'][] = $theme . '/admin_css.admin_css';
    }
  }
}