Add style by element name

@param string $element
@param array  $styles
424968
public function addByElement($element, array $styles)
    {
        $this->elements[$element] = array_merge_recursive($this->getByElement($element), $styles);
    }
841777
public function addElements(array $elements) {
		foreach ($elements as $name => $element) {
			if (is_string($name)) {
				$this->addElement($element, $name);
			} else {
				$this->addElement($element);
			}
		}
		
		return $this;
	}
918974
public function addStyle($element, $priority = 0, $location = 'head')
    {
        if (!\is_array($element)) {
            $element = ['href' => (string) $element];
        }
        if (empty($element['href'])) {
            return false;
        }
        if (!isset($this->styles[$location])) {
            $this->styles[$location] = [];
        }

        $id = !empty($element['id']) ? ['id' => (string) $element['id']] : [];
        $href = $element['href'];
        $type = !empty($element['type']) ? (string) $element['type'] : 'text/css';
        $media = !empty($element['media']) ? (string) $element['media'] : null;
        unset(
            $element['tag'],
            $element['id'],
            $element['rel'],
            $element['content'],
            $element['href'],
            $element['type'],
            $element['media']
        );

        $this->styles[$location][md5($href) . sha1($href)] = [
                ':type' => 'file',
                ':priority' => (int) $priority,
                'href' => $href,
                'type' => $type,
                'media' => $media,
                'element' => $element
            ] + $id;

        return true;
    }
158758
public function addRow(array $row, Style $style = null)
    {
        if (!empty($row)) {
            $style = $style instanceof Style ? $style : $this->styler->getDefaultStyle();
            $this->styler->addStyle($style);
            $this->sheetFile->fwrite($this->sheet->addRow($row, $style));
        }
    }
199163
public function addElement($element, $name = null, $attrs = null) {
		switch (true) {
			case is_array($element):
				$newElement = new static($element);
				break;

			case $element instanceof self:
			case $element instanceof ListElement:
				$newElement = $element;
				break;

			default:
				$newElement = new ListElement($element, $attrs);
		}
		
		return parent::addElement($newElement, $name);
	}
479532
public function addStyleId($styleId)
    {
        $styleId = (string)$styleId;
        if (!in_array($styleId, $this->styleIds)) {
            array_push($this->styleIds, $styleId);
        }
        return $this;
    }
639058
protected function addAttributes($element, $data)
    {
        foreach ($data as $attrKey => $attrVal) {
            $element->setAttribute($attrKey, $attrVal);
        }
    }
57249
public static void applyStyle(Element element, Style style) {
		if (style != null && element != null) {
			if (style instanceof ShapeStyle) {
				applyShapeStyle(element, (ShapeStyle) style);
			} else if (style instanceof FontStyle) {
				FontStyle fontStyle = (FontStyle) style;
				element.getStyle().setProperty("fontSize", "" + fontStyle.getFontSize());
				element.getStyle().setProperty("color", fontStyle.getFillColor());
				element.getStyle().setProperty("fontFamily", fontStyle.getFontFamily());
				element.getStyle().setProperty("fontWeight", fontStyle.getFontWeight());
				element.getStyle().setProperty("fontStyle", fontStyle.getFontStyle());
			} else if (style instanceof PictureStyle) {
				PictureStyle picturStyle = (PictureStyle) style;
				if (SC.isIE()) { //TODO: it's a VML decoder, why make this check?
					element.getStyle().setProperty("filter", "alpha(opacity=" + 100 * picturStyle.getOpacity() + ")");
				} else {
					element.setAttribute("style", "opacity:" + picturStyle.getOpacity() + ";");
				}
			}
		}
	}
137730
public function addStyle($style) {
        $style = trim($style);
        if ($style != '') {
            if (strpos($this->style, $style) === false) {
                $this->style .= " 
                $style ";
            }
        }
    }
1373112
protected function addStyleElementToDocument(\DOMDocument $document, $css)
    {
        $styleElement = $document->createElement('style', $css);
        $styleAttribute = $document->createAttribute('type');
        $styleAttribute->value = 'text/css';
        $styleElement->appendChild($styleAttribute);

        $bodyElement = $this->getBodyElement($document);
        $bodyElement->appendChild($styleElement);
    }
581974
function (element, style) {
			var styleString = '';

			for (var key in style) {
				styleString += key + ': ' + style[key] + ';';
			}

			element.setAttribute('style', styleString);

			return element;
		}
1017898
protected function elementStylesToAttribute( DOMElement $element )
    {
        $styleString = $element->getAttribute( 'style' );
        if ( $styleString )
        {
            $styleArray = explode( ';', $styleString );
            foreach( $styleArray as $style )
            {
                if ( !$style )
                    continue;

                list( $name, $value ) = explode( ':', $style );
                $name  = strtolower( trim( $name ) );
                $value = trim( $value );

                if ( $name === 'float' || $name === 'text-align' )
                    $name = 'align';

                if ( $name )
                {
                    try
                    {
                        $element->setAttribute( $name, $value );
                    }
                    catch (DOMException $e)
                    {
                        $this->handleError( self::ERROR_DATA, $e->getMessage() );
                    }
                }
            }
        }
    }
934563
private function appendStyles(array $styles)
    {
        if (empty($styles)) {
            return;
        }

        $string = '';
        $prependSemicolon = false;
        foreach ($styles as $key => $value) {
            if ($prependSemicolon) {
                $string .= '; ';
            }
            $prependSemicolon = true;
            $string .= $key.': '.$value;
        }

        $this->appendAttribute('style', $string);
    }
350866
public function addRow(array $row, Style $style)
    {
        $columnCount = count($row);
        $this->updateMaxColumnCount($columnCount);
        $cellXml = $this->getCellXml($row, $style);

        return $this->getRowXml($columnCount, $cellXml);
    }
1327704
public function addStyle($style,$options=array())
    {
        $options["type"] = Utility::get($options, "type", "text/css");

        $this->tags[md5($style)] = array(
            "at"=>'begin',
            "tag"=>"style",
            "options"=>$options,
            "content"=>$style,
        );
        return $this;
    }
992263
private void applyHtmlStyle(Element element, ShapeStyle style) {
		if (style.getFillColor() != null && !"".equals(style.getFillColor())) {
			Dom.setStyleAttribute(element, "fillColor", style.getFillColor());
		}
		Dom.setStyleAttribute(element, "fillOpacity", Float.toString(style.getFillOpacity()));
		if (style.getStrokeColor() != null && !"".equals(style.getStrokeColor())) {
			Dom.setStyleAttribute(element, "stroke", style.getStrokeColor());
		}
		Dom.setStyleAttribute(element, "strokeOpacity", Float.toString(style.getStrokeOpacity()));
		if (style.getStrokeWidth() >= 0) {
			Dom.setStyleAttribute(element, "strokeWidth", Float.toString(style.getStrokeWidth()));
		}
	}
548262
public function config(...$styles)
    {
        $version = FA::version(class_basename(__CLASS__), $this->version);
        
        foreach ($styles as $style) {
           $this->loadStyle($version, $style);
       }
    }