You are here

function css_injector_css_alter in CSS Injector 7

Implements hook_css_alter(). Since we're trying to give the administrator complete control, we'll move CSS that this module has added to a high weight, higher even than the theme's CSS files. Currently the weight is 200 + the crid, which is currently higher than Bartik's CSS.

Parameters

$css: The array of CSS files.

File

./css_injector.module, line 90
Allows administrators to inject CSS into the page output based on configurable rules. Useful for adding simple CSS tweaks without modifying a site's official theme.

Code

function css_injector_css_alter(&$css) {
  $css_rules = _css_injector_load_rule();
  foreach ($css_rules as $css_rule) {
    $file_uri = _css_injector_rule_uri($css_rule['crid']);
    if (!empty($css[$file_uri])) {
      $css[$file_uri]['weight'] = 200 + $css_rule['crid'];
    }
  }
}