You are here

function google_cse_library_info_build in Google Custom Search Engine 8.3

Same name and namespace in other branches
  1. 8.2 google_cse.module \google_cse_library_info_build()

Implements hook_library_info_build().

File

./google_cse.module, line 99
Display a Google Custom Search Engine (CSE) on your site.

Code

function google_cse_library_info_build() {
  $libraries = [];
  $config = \Drupal::config('search.page.google_cse_search');

  // Add the custom css.
  if (Drupal::moduleHandler()
    ->moduleExists('google_cse')) {
    $libraries['google_cse/googlecseCustomcss'] = [
      'css' => [
        'theme' => [
          $config
            ->get('configuration')['custom_css'] => [
            'type' => 'external',
          ],
        ],
      ],
    ];
  }
  return $libraries;
}