You are here

function css_editor_page_attachments in CSS Editor 8

Implements hook_page_attachments().

File

./css_editor.module, line 27
Allows users to apply customized CSS to themes.

Code

function css_editor_page_attachments(array &$page) {
  $theme = \Drupal::theme()
    ->getActiveTheme()
    ->getName();
  if (_css_editor_get_stylesheet($theme)) {
    $page['#attached']['library'][] = $theme . '/css_editor';
  }
}