You are here

function google_webfont_loader_api_preprocess_html in Webfont Loader 8

Same name and namespace in other branches
  1. 7 google_webfont_loader_api.module \google_webfont_loader_api_preprocess_html()

Implements hook_preprocess_HOOK() for HTML document templates.

File

./google_webfont_loader_api.module, line 100
Google Webfont Loader API primary file.

Code

function google_webfont_loader_api_preprocess_html(&$variables) {
  $config = \Drupal::config('google_webfont_loader_api.settings');
  if ($config
    ->get('display_style') == 'hidden') {
    if (!isset($variables['html_attributes']['class'])) {
      $variables['html_attributes']['class'] = array();
    }
    $variables['html_attributes']['class'][] = 'wf-loading';
  }
}