ThemeInitialization::resolveStyleSheetPlaceholders

protected ThemeInitialization::resolveStyleSheetPlaceholders($css_file)

Gets CSS file where tokens have been resolved.

@todo Remove in Drupal 9.0.x.

Parameters

string $css_file: CSS file which may contain tokens.

Return value

string CSS file where placeholders are replaced.

File

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

Class

ThemeInitialization
Provides the theme initialization logic.

Namespace

Drupal\Core\Theme

Code

protected function resolveStyleSheetPlaceholders($css_file) {
  $token_candidate = explode('/', $css_file) [0];
  if (!preg_match('/@[A-z0-9_-]+/', $token_candidate)) {
    return $css_file;
  }

  $token = substr($token_candidate, 1);

  // Prime extensions.
  $extensions = $this->getExtensions();
  if (isset($extensions[$token])) {
    return str_replace($token_candidate, $extensions[$token]->getPath(), $css_file);
  }
}
doc_Drupal
2016-10-29 09:48:07
Comments
Leave a Comment

Please login to continue.