hook_css_alter

hook_css_alter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface $assets)

Alter CSS files before they are output on the page.

Parameters

$css: An array of all CSS items (files and inline CSS) being requested on the page.

\Drupal\Core\Asset\AttachedAssetsInterface $assets: The assets attached to the current response.

See also

Drupal\Core\Asset\LibraryResolverInterface::getCssAssets()

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/lib/Drupal/Core/Render/theme.api.php, line 993
Hooks and documentation related to the theme and render system.

Code

function hook_css_alter(&$css, \Drupal\Core\Asset\AttachedAssetsInterface $assets) {
  // Remove defaults.css file.
  unset($css[drupal_get_path('module', 'system') . '/defaults.css']);
}
doc_Drupal
2016-10-29 09:17:53
Comments
Leave a Comment

Please login to continue.