public function css($property, ...$arguments)
{
if (count($arguments) == 0 && is_string($property)) {
$properties = new Query\Css\Properties((string) $this->attr('style'));
if (isset($properties[$property])) {
return $properties[$property];
}
return NULL;
}
$values = $this->getSetterValues($property, isset($arguments[0]) ? $arguments[0] : NULL);
//set list of properties to all elements
$this->each(function (\DOMElement $node, $index) use($values) {
$properties = new Query\Css\Properties($node->getAttribute('style'));
foreach ($values as $name => $value) {
$properties[$name] = $properties->compileValue($value, $node, $index, isset($properties[$name]) ? $properties[$name] : NULL);
}
if (count($properties) > 0) {
$node->setAttribute('style', (string) $properties);
} elseif ($node->hasAttribute('style')) {
$node->removeAttribute('style');
}
}, TRUE);
return $this;
}