1 template.php basis_css_alter(&$css)

Implements hook_css_alter().

File

core/themes/basis/template.php, line 10
Basis preprocess functions and theme function overrides.

Code

function basis_css_alter(&$css) {
  // Remove the Basis css/component/menu-dropdown.css and add breakpoint files
  // if using a custom breakpoint.
  $config = config('menu.settings');
  $path = backdrop_get_path('theme', 'basis');
  if (isset($css[$path . '/css/component/menu-dropdown.css']) && $config->get('menu_breakpoint') == 'custom') {
    $dropdown_css = $css[$path . '/css/component/menu-dropdown.css'];
    unset($css[$path . '/css/component/menu-dropdown.css']);

    $weight = $dropdown_css['weight'];
    $weight += 0.0001;
    $css[$path . '/css/component/menu-dropdown.breakpoint.css'] = $dropdown_css;
    $css[$path . '/css/component/menu-dropdown.breakpoint.css']['weight'] = $weight;
    $css[$path . '/css/component/menu-dropdown.breakpoint.css']['data'] = $path . '/css/component/menu-dropdown.breakpoint.css';

    $weight += 0.0001;
    $css[$path . '/css/component/menu-dropdown.breakpoint-queries.css'] = $dropdown_css;
    $css[$path . '/css/component/menu-dropdown.breakpoint-queries.css']['weight'] = $weight;
    $css[$path . '/css/component/menu-dropdown.breakpoint-queries.css']['media'] = 'all and (min-width: ' . $config->get('menu_breakpoint_custom') . ')';
    $css[$path . '/css/component/menu-dropdown.breakpoint-queries.css']['data'] = $path . '/css/component/menu-dropdown.breakpoint-queries.css';
  }
}