src/Css/Css.php
public function set($css, $value = NULL) {

		$css = trim(strtolower($css));


		if (func_num_args() == 1) {

			$elements = explode(';', $css);

			foreach ($elements as $element) {

				if (!$element = trim($element)) {
					continue;
				}

				$element = explode(':', $element);

				if (!$element[0] = trim(@$element[0])) {
					continue;
				}

				$element[1] = trim(@$element[1]);

				$this->set($element[0], $element[1]);
			}

			return;
		}

		$css = strtolower($css);
		$this->css[$css] = $value;
		return $this;
	}
public function set($css, $value = NULL) {

		$css = trim(strtolower($css));


		if (func_num_args() == 1) {

			$elements = explode(';', $css);

			foreach ($elements as $element) {

				if (!$element = trim($element)) {
					continue;
				}

				$element = explode(':', $element);

				if (!$element[0] = trim(@$element[0])) {
					continue;
				}

				$element[1] = trim(@$element[1]);

				$this->set($element[0], $element[1]);
			}

			return;
		}

		$css = strtolower($css);
		$this->css[$css] = $value;
		return $this;
	}
public function set ( $ css , $ value = NULL ) { $ css = trim ( strtolower ( $ css ) ) ; if ( func_num_args ( ) == 1 ) { $ elements = explode ( ';' , $ css ) ; foreach ( $ elements as $ element ) { if ( ! $ element = trim ( $ element ) ) { continue ; } $ element = explode ( ':' , $ element ) ; if ( ! $ element [ 0 ] = trim ( @ $ element [ 0 ] ) ) { continue ; } $ element [ 1 ] = trim ( @ $ element [ 1 ] ) ; $ this -> set ( $ element [ 0 ] , $ element [ 1 ] ) ; } return ; } $ css = strtolower ( $ css ) ; $ this -> css [ $ css ] = $ value ; return $ this ; }
Sets CSS value.

<code>
$css->set('width: 20px');
$css->set('color', '#ff0000');
</code>

@param mixed $css CSS property or CSS expression string
@param string $value
@return Css
Sets CSS value .