public function CssOptimizer::clean in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Asset/CssOptimizer.php \Drupal\Core\Asset\CssOptimizer::clean()
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
2 calls to CssOptimizer::clean()
- CssOptimizer::processCss in core/
lib/ Drupal/ Core/ Asset/ CssOptimizer.php - Processes the contents of a stylesheet for aggregation.
- CssOptimizer::processFile in core/
lib/ Drupal/ Core/ Asset/ CssOptimizer.php - Build aggregate CSS file.
File
- core/
lib/ Drupal/ Core/ Asset/ CssOptimizer.php, line 65
Class
- CssOptimizer
- Optimizes a CSS asset.
Namespace
Drupal\Core\AssetCode
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;
}