public function subvalue() {
		$replace_colors = & $this->parser->data['csstidy']['replace_colors'];

		$this->sub_value = trim($this->sub_value);
		if ($this->sub_value == '') { // caution : '0'
			return;
		}

		$important = '';
		if ($this->parser->is_important($this->sub_value)) {
			$important = '!important';
		}
		$this->sub_value = $this->parser->gvw_important($this->sub_value);

		// Compress font-weight
		if ($this->property === 'font-weight' && $this->parser->get_cfg('compress_font-weight')) {
			if ($this->sub_value === 'bold') {
				$this->sub_value = '700';
				$this->parser->log('Optimised font-weight: Changed "bold" to "700"', 'Information');
			} elseif ($this->sub_value === 'normal') {
				$this->sub_value = '400';
				$this->parser->log('Optimised font-weight: Changed "normal" to "400"', 'Information');
			}
		}

		$temp = $this->compress_numbers($this->sub_value);
		if (strcasecmp($temp, $this->sub_value) !== 0) {
			if (strlen($temp) > strlen($this->sub_value)) {
				$this->parser->log('Fixed invalid number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
			} else {
				$this->parser->log('Optimised number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
			}
			$this->sub_value = $temp;
		}
		if ($this->parser->get_cfg('compress_colors')) {
			$temp = $this->cut_color($this->sub_value);
			if ($temp !== $this->sub_value) {
				if (isset($replace_colors[$this->sub_value])) {
					$this->parser->log('Fixed invalid color name: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
				} else {
					$this->parser->log('Optimised color: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
				}
				$this->sub_value = $temp;
			}
		}
		$this->sub_value .= $important;
	}
public function subvalue() {
		$replace_colors = & $this->parser->data['csstidy']['replace_colors'];

		$this->sub_value = trim($this->sub_value);
		if ($this->sub_value == '') { // caution : '0'
			return;
		}

		$important = '';
		if ($this->parser->is_important($this->sub_value)) {
			$important = '!important';
		}
		$this->sub_value = $this->parser->gvw_important($this->sub_value);

		// Compress font-weight
		if ($this->property === 'font-weight' && $this->parser->get_cfg('compress_font-weight')) {
			if ($this->sub_value === 'bold') {
				$this->sub_value = '700';
				$this->parser->log('Optimised font-weight: Changed "bold" to "700"', 'Information');
			} elseif ($this->sub_value === 'normal') {
				$this->sub_value = '400';
				$this->parser->log('Optimised font-weight: Changed "normal" to "400"', 'Information');
			}
		}

		$temp = $this->compress_numbers($this->sub_value);
		if (strcasecmp($temp, $this->sub_value) !== 0) {
			if (strlen($temp) > strlen($this->sub_value)) {
				$this->parser->log('Fixed invalid number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
			} else {
				$this->parser->log('Optimised number: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
			}
			$this->sub_value = $temp;
		}
		if ($this->parser->get_cfg('compress_colors')) {
			$temp = $this->cut_color($this->sub_value);
			if ($temp !== $this->sub_value) {
				if (isset($replace_colors[$this->sub_value])) {
					$this->parser->log('Fixed invalid color name: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Warning');
				} else {
					$this->parser->log('Optimised color: Changed "' . $this->sub_value . '" to "' . $temp . '"', 'Information');
				}
				$this->sub_value = $temp;
			}
		}
		$this->sub_value .= $important;
	}
public function subvalue ( ) { $ replace_colors = & $ this -> parser -> data [ 'csstidy' ] [ 'replace_colors' ] ; $ this -> sub_value = trim ( $ this -> sub_value ) ; if ( $ this -> sub_value == '' ) { // caution : '0' return ; } $ important = '' ; if ( $ this -> parser -> is_important ( $ this -> sub_value ) ) { $ important = '!important' ; } $ this -> sub_value = $ this -> parser -> gvw_important ( $ this -> sub_value ) ; // Compress font-weight if ( $ this -> property === 'font-weight' && $ this -> parser -> get_cfg ( 'compress_font-weight' ) ) { if ( $ this -> sub_value === 'bold' ) { $ this -> sub_value = '700' ; $ this -> parser -> log ( 'Optimised font-weight: Changed "bold" to "700"' , 'Information' ) ; } elseif ( $ this -> sub_value === 'normal' ) { $ this -> sub_value = '400' ; $ this -> parser -> log ( 'Optimised font-weight: Changed "normal" to "400"' , 'Information' ) ; } } $ temp = $ this -> compress_numbers ( $ this -> sub_value ) ; if ( strcasecmp ( $ temp , $ this -> sub_value ) !== 0 ) { if ( strlen ( $ temp ) > strlen ( $ this -> sub_value ) ) { $ this -> parser -> log ( 'Fixed invalid number: Changed "' . $ this -> sub_value . '" to "' . $ temp . '"' , 'Warning' ) ; } else { $ this -> parser -> log ( 'Optimised number: Changed "' . $ this -> sub_value . '" to "' . $ temp . '"' , 'Information' ) ; } $ this -> sub_value = $ temp ; } if ( $ this -> parser -> get_cfg ( 'compress_colors' ) ) { $ temp = $ this -> cut_color ( $ this -> sub_value ) ; if ( $ temp !== $ this -> sub_value ) { if ( isset ( $ replace_colors [ $ this -> sub_value ] ) ) { $ this -> parser -> log ( 'Fixed invalid color name: Changed "' . $ this -> sub_value . '" to "' . $ temp . '"' , 'Warning' ) ; } else { $ this -> parser -> log ( 'Optimised color: Changed "' . $ this -> sub_value . '" to "' . $ temp . '"' , 'Information' ) ; } $ this -> sub_value = $ temp ; } } $ this -> sub_value .= $ important ; }
Optimises a sub-value
@access public
@version 1.0
Optimises a sub - value