Chris@0: selector = $selector; Chris@0: $this->css = $css; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Adds a property/value pair to the CSS to be added to this element. Chris@0: * Chris@0: * @param $property Chris@0: * The CSS property to be changed. Chris@0: * @param $value Chris@0: * The new value of the CSS property. Chris@0: * Chris@0: * @return $this Chris@0: */ Chris@0: public function setProperty($property, $value) { Chris@0: $this->css[$property] = $value; Chris@0: return $this; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Implements Drupal\Core\Ajax\CommandInterface:render(). Chris@0: */ Chris@0: public function render() { Chris@0: Chris@0: return [ Chris@0: 'command' => 'css', Chris@0: 'selector' => $this->selector, Chris@0: 'argument' => $this->css, Chris@0: ]; Chris@0: } Chris@0: Chris@0: }