X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/19e297c21b10b1b8a3acad5e73fc71dcb35db44a..6932310fd58ebef145fa01eb76edf7150284d8ea:/vendor/oyejorge/less.php/lib/Less/Tree/Attribute.php diff --git a/vendor/oyejorge/less.php/lib/Less/Tree/Attribute.php b/vendor/oyejorge/less.php/lib/Less/Tree/Attribute.php new file mode 100644 index 00000000..32b8900d --- /dev/null +++ b/vendor/oyejorge/less.php/lib/Less/Tree/Attribute.php @@ -0,0 +1,54 @@ +key = $key; + $this->op = $op; + $this->value = $value; + } + + public function compile($env){ + + $key_obj = is_object($this->key); + $val_obj = is_object($this->value); + + if( !$key_obj && !$val_obj ){ + return $this; + } + + return new Less_Tree_Attribute( + $key_obj ? $this->key->compile($env) : $this->key , + $this->op, + $val_obj ? $this->value->compile($env) : $this->value); + } + + /** + * @see Less_Tree::genCSS + */ + public function genCSS( $output ){ + $output->add( $this->toCSS() ); + } + + public function toCSS(){ + $value = $this->key; + + if( $this->op ){ + $value .= $this->op; + $value .= (is_object($this->value) ? $this->value->toCSS() : $this->value); + } + + return '[' . $value . ']'; + } +} \ No newline at end of file