You are here

function csstidy_optimise::value in Advanced CSS/JS Aggregation 7

Same name and namespace in other branches
  1. 6 advagg_css_compress/csstidy/class.csstidy_optimise.inc \csstidy_optimise::value()

Optimises values @access public @version 1.0

File

advagg_css_compress/csstidy/class.csstidy_optimise.inc, line 111

Class

csstidy_optimise
CSS Optimising Class

Code

function value() {
  $shorthands =& $GLOBALS['csstidy']['shorthands'];

  // optimise shorthand properties
  if (isset($shorthands[$this->property])) {
    $temp = csstidy_optimise::shorthand($this->value);

    // FIXME - move
    if ($temp != $this->value) {
      $this->parser
        ->log('Optimised shorthand notation (' . $this->property . '): Changed "' . $this->value . '" to "' . $temp . '"', 'Information');
    }
    $this->value = $temp;
  }

  // Remove whitespace at ! important
  if ($this->value != $this
    ->compress_important($this->value)) {
    $this->parser
      ->log('Optimised !important', 'Information');
  }
}