ThemeInitialization::prepareStylesheetsRemove

protected ThemeInitialization::prepareStylesheetsRemove(Extension $theme, $base_themes)

Prepares stylesheets-remove specified in the *.info.yml file.

@todo Remove in Drupal 9.0.x.

Parameters

\Drupal\Core\Extension\Extension $theme: The theme extension object.

\Drupal\Core\Extension\Extension[] $base_themes: An array of base themes.

Return value

string[] The list of stylesheets-remove specified in the *.info.yml file.

File

core/lib/Drupal/Core/Theme/ThemeInitialization.php, line 309

Class

ThemeInitialization
Provides the theme initialization logic.

Namespace

Drupal\Core\Theme

Code

protected function prepareStylesheetsRemove(Extension $theme, $base_themes) {
  // Prepare stylesheets from this theme as well as all ancestor themes.
  // We work it this way so that we can have child themes remove CSS files
  // easily from parent.
  $stylesheets_remove = array();
  // Grab stylesheets from base theme.
  foreach ($base_themes as $base) {
    if (!empty($base->info['stylesheets-remove'])) {
      foreach ($base->info['stylesheets-remove'] as $css_file) {
        $css_file = $this->resolveStyleSheetPlaceholders($css_file);
        $stylesheets_remove[$css_file] = $css_file;
      }
    }
  }

  // Add stylesheets used by this theme.
  if (!empty($theme->info['stylesheets-remove'])) {
    foreach ($theme->info['stylesheets-remove'] as $css_file) {
      $css_file = $this->resolveStyleSheetPlaceholders($css_file);
      $stylesheets_remove[$css_file] = $css_file;
    }
  }
  return $stylesheets_remove;
}
doc_Drupal
2016-10-29 09:48:07
Comments
Leave a Comment

Please login to continue.