CssOptimizer::processCss

protected CssOptimizer::processCss($contents, $optimize = FALSE) Processes the contents of a stylesheet for aggregation. Parameters $contents: The contents of the stylesheet. $optimize: (optional) Boolean whether CSS contents should be minified. Defaults to FALSE. Return value Contents of the stylesheet including the imported stylesheets. File core/lib/Drupal/Core/Asset/CssOptimizer.php, line 185 Class CssOptimizer Optimizes a CSS asset. Namespace Drupal\Core\Asset Code protected fun

CssOptimizer::optimize

public CssOptimizer::optimize(array $css_asset) Optimizes an asset. Parameters array $asset: An asset. Return value string The optimized asset's contents. Overrides AssetOptimizerInterface::optimize File core/lib/Drupal/Core/Asset/CssOptimizer.php, line 22 Class CssOptimizer Optimizes a CSS asset. Namespace Drupal\Core\Asset Code public function optimize(array $css_asset) { if ($css_asset['type'] != 'file') { throw new \Exception('Only file CSS assets can be optimized.'); }

CssOptimizer::loadNestedFile

protected CssOptimizer::loadNestedFile($matches) Loads stylesheets recursively and returns contents with corrected paths. This function is used for recursive loading of stylesheets and returns the stylesheet content with all url() paths corrected. Parameters array $matches: An array of matches by a preg_replace_callback() call that scans for @import-ed CSS files, except for external CSS files. Return value The contents of the CSS file at $matches[1], with corrected paths. See also \Drupal\Co

CssOptimizer::loadFile

public CssOptimizer::loadFile($file, $optimize = NULL, $reset_basepath = TRUE) Loads the stylesheet and resolves all @import commands. Loads a stylesheet and replaces @import commands with the contents of the imported file. Use this instead of file_get_contents when processing stylesheets. The returned contents are compressed removing white space and comments only when CSS aggregation is enabled. This optimization will not apply for color.module enabled themes with CSS aggregation turned off. N

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 //

CssOptimizer::$rewriteFileURIBasePath

The base path used by rewriteFileURI(). Type: string File core/lib/Drupal/Core/Asset/CssOptimizer.php, line 17 Class CssOptimizer Optimizes a CSS asset. Namespace Drupal\Core\Asset Code public $rewriteFileURIBasePath;

CssOptimizer

Optimizes a CSS asset. Hierarchy class \Drupal\Core\Asset\CssOptimizer implements AssetOptimizerInterface File core/lib/Drupal/Core/Asset/CssOptimizer.php, line 10 Namespace Drupal\Core\Asset Members Name Modifiers Type Description CssOptimizer::$rewriteFileURIBasePath public property The base path used by rewriteFileURI(). CssOptimizer::clean public function Processes the contents of a CSS asset for cleanup. Overrides AssetOptimizerInterface::clean CssOptimize

CssCommand::__construct

public CssCommand::__construct($selector, array $css = array()) Constructs a CssCommand object. Parameters string $selector: A CSS selector for elements to which the CSS will be applied. array $css: An array of CSS property/value pairs to set. File core/lib/Drupal/Core/Ajax/CssCommand.php, line 45 Class CssCommand An AJAX command for calling the jQuery css() method. Namespace Drupal\Core\Ajax Code public function __construct($selector, array $css = array()) { $this->selector = $s

CssCommand::setProperty

public CssCommand::setProperty($property, $value) Adds a property/value pair to the CSS to be added to this element. Parameters $property: The CSS property to be changed. $value: The new value of the CSS property. Return value $this File core/lib/Drupal/Core/Ajax/CssCommand.php, line 60 Class CssCommand An AJAX command for calling the jQuery css() method. Namespace Drupal\Core\Ajax Code public function setProperty($property, $value) { $this->css[$property] = $value; return $th

CssCommand::render

public CssCommand::render() Implements Drupal\Core\Ajax\CommandInterface:render(). Overrides CommandInterface::render File core/lib/Drupal/Core/Ajax/CssCommand.php, line 68 Class CssCommand An AJAX command for calling the jQuery css() method. Namespace Drupal\Core\Ajax Code public function render() { return array( 'command' => 'css', 'selector' => $this->selector, 'argument' => $this->css, ); }