Runs special unit/directional compressions

Paramètres

(string) prop: CSS Property:

(string) val: Value of CSS Property:

Fichier

advagg_css_compress/css-compressor-3.x/src/lib/Individuals.inc, line 62

Classe

CSSCompression_Individuals
CSS Compressor [VERSION] [DATE] Corey Hart @ <a href="http://www.codenothing.com">http://www.codenothing.com</a>

Code

public function individuals($prop, $val) {
    // Properties should always be lowercase
    $prop = strtolower($prop);
    // Split up each definiton for color and numeric compressions
    $parts = preg_split($this->rspace, $val);
    foreach ($parts as &$v) {
        if (!$v || $v == '') {
            continue;
        }
        // Remove uneeded decimals/units
        if ($this->options['format-units']) {
            $v = $this->Numeric
                ->numeric($v);
        }
        // Color compression
        $v = $this->Color
            ->color($v);
    }
    $val = trim(implode(' ', $parts));
    // Special border radius handling
    if (preg_match($this->rborderradius, $prop)) {
        $val = $this->borderRadius($prop, $val);
    }
    else {
        if ($this->options['directional-compress'] && count($parts) > 1 && preg_match($this->rdirectional, $prop)) {
            $val = $this->directionals(strtolower($val));
        }
    }
    // Font-weight converter
    if ($this->options['fontweight2num'] && ($prop == 'font-weight' || $prop == 'font')) {
        $val = $this->fontweight($val);
    }
    // Special font value conversions
    if ($prop == 'font') {
        $val = $this->font($val);
    }
    // Special clip value compressions
    if ($prop == 'clip') {
        $val = $this->clip($val);
    }
    // None to 0 converter
    $val = $this->none($prop, $val);
    // MSIE Filters
    $val = $this->filter($prop, $val);
    // Return for list retrival
    return array(
        $prop,
        $val,
    );
}