CssOptimizer::clean

public CssOptimizer::clean($contents)

Processes the contents of a CSS asset for cleanup.

Parameters

string $contents: The contents of the CSS asset.

Return value

string Contents of the CSS asset.

Overrides AssetOptimizerInterface::clean

File

core/lib/Drupal/Core/Asset/CssOptimizer.php, line 42

Class

CssOptimizer
Optimizes a CSS asset.

Namespace

Drupal\Core\Asset

Code

public function clean($contents) {
  // Remove multiple charset declarations for standards compliance (and fixing
  // Safari problems).
  $contents = preg_replace('/^@charset\s+[\'"](\S*?)\b[\'"];/i', '', $contents);

  return $contents;
}
doc_Drupal
2016-10-29 08:59:17
Comments
Leave a Comment

Please login to continue.