function asset_injector_css_alter in Asset Injector 8.2
Same name and namespace in other branches
- 8 asset_injector.module \asset_injector_css_alter()
Implements hook_css_alter().
File
- ./
asset_injector.module, line 53 - Contains module asset_injector.
Code
function asset_injector_css_alter(array &$css, AttachedAssetsInterface $assets) {
$libraries = $assets
->getLibraries();
foreach (asset_injector_library_info_build() as $lib_id => $library) {
if (in_array("asset_injector/{$lib_id}", $libraries) && !empty($library['css'])) {
foreach ($library['css'] as $group) {
foreach (array_keys($group) as $file) {
$css[trim($file, '/ ')]['group'] = 999;
}
}
}
}
}