You are here

function micon_library_info_build in Micon 8

Same name and namespace in other branches
  1. 2.x micon.module \micon_library_info_build()

Implements hook_library_info_build().

File

./micon.module, line 109
Contains micon.module.

Code

function micon_library_info_build() {
  $libraries = [];
  foreach (Micon::loadMultiple() as $micon) {
    if ($stylesheet = $micon
      ->getStylesheet()) {
      $libraries['micon.' . $micon
        ->id()]['css']['theme'][$stylesheet] = [];

      // Add SVG library if necessary.
      if ($micon
        ->type() == 'image') {
        $libraries['micon.' . $micon
          ->id()]['dependencies'][] = 'micon/micon.svg';
      }
    }
  }
  return $libraries;
}