You are here

protected function LocalRemoteAssetTrait::processCssAssets in Libraries API 8.3

Gets the CSS assets attached to this library.

Parameters

array $assets:

Return value

array An array of CSS assets of the library following the core library CSS structure. The keys of the array must be among the SMACSS categories 'base', 'layout, 'component', 'state', and 'theme'. The value of each category is in turn an array where the keys are the file paths of the CSS files and values are CSS options.

See also

https://smacss.com/

\Drupal\libraries\ExternalLibrary\Asset\SingleAssetLibraryTrait::getCssAssets()

File

src/ExternalLibrary/Asset/LocalRemoteAssetTrait.php, line 74

Class

LocalRemoteAssetTrait
A trait for asset libraries that serve local and remote files.

Namespace

Drupal\libraries\ExternalLibrary\Asset

Code

protected function processCssAssets(array $assets) {

  // @todo Consider somehow caching the processed information.
  $processed_assets = [];
  foreach ($assets as $category => $category_assets) {

    // @todo Somehow consolidate this with getJsAssets().
    foreach ($category_assets as $filename => $options) {
      $processed_assets[$category][$this
        ->getPathPrefix() . '/' . $filename] = $options;
    }
  }
  return $processed_assets;
}