You are here

function advagg_mod_css_alter in Advanced CSS/JS Aggregation 8.2

Same name and namespace in other branches
  1. 8.4 advagg_mod/advagg_mod.module \advagg_mod_css_alter()
  2. 8.3 advagg_mod/advagg_mod.module \advagg_mod_css_alter()
  3. 7.2 advagg_mod/advagg_mod.module \advagg_mod_css_alter()

Implements hook_css_alter().

File

advagg_mod/advagg_mod.module, line 87
Advanced aggregation modifier module.

Code

function advagg_mod_css_alter(&$css) {
  if (\Drupal::moduleHandler()
    ->moduleExists('advagg') && !advagg_enabled()) {
    return;
  }
  $config = \Drupal::config('advagg_mod.settings');
  if ($config
    ->get('css_adjust_sort_external') || $config
    ->get('css_adjust_sort_browsers')) {
    advagg_mod_sort_css_js($css, 'css');
  }

  // Force all CSS to be preprocessed.
  if ($config
    ->get('css_preprocess')) {
    foreach ($css as &$values) {
      $values['preprocess'] = TRUE;
    }
    unset($values);
  }
}