Merges two sets of style properties taking !important into account
@param array $styleA
@param array $styleB
@return array
779640
private function _mergeStyles(array $styleA, array $styleB)
    {
        foreach($styleB as $prop => $val) {
            if(!isset($styleA[$prop])
                || substr(str_replace(" ", "", strtolower($styleA[$prop])), -10) !== "!important")
            {
                $styleA[$prop] = $val;
            }
        }

        return $styleA;
    }
79985
public function render(array $style)
    {
        $result = [];

        if (isset($style['feature'])) {
            $result[] = $this->renderStyle('feature', $style['feature']);
        }

        if (isset($style['element'])) {
            $result[] = $this->renderStyle('element', $style['element']);
        }

        foreach ($style['rules'] as $rule => $value) {
            $result[] = $this->renderStyle($rule, $value);
        }

        return implode('|', $result);
    }
562529
protected function buildStyle(string $name, array $style, array $matches): array
    {
        foreach ($matches[0] as $i => $match) {
            $name  = \str_replace($match, '', $name);
            $type  = \strtolower($matches[1][$i]) ?: 'fg';

            if (\defined($color = static::class . '::' . \strtoupper($matches[2][$i]))) {
                $style += [$type => \constant($color)];
            }
        }

        return [\lcfirst($name) ?: 'line', $style];
    }
479532
public function addStyleId($styleId)
    {
        $styleId = (string)$styleId;
        if (!in_array($styleId, $this->styleIds)) {
            array_push($this->styleIds, $styleId);
        }
        return $this;
    }
18842
public function appendStyle($style, array $params = [], $conditional = '')
    {
        return $this->setStyle($style, $params, false, $conditional);
    }
725687
public function addStyles(array $styles)
    {
        if (!$this->styleSet) {
            $this->styleSet = new DefaultStyleSet();
        }

        $this->styleSet->merge($styles);

        return $this;
    }
514457
public function style($assets, array $attributes = [])
    {

        $manager = clone $this;

        $collection = (new CssCollection)->setAttributes($attributes);

        $manager->clear()
                ->addCollection($collection)
                ->addArray((array) $assets);

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

        return $this->getRowXml($columnCount, $cellXml);
    }
49068
public function addStyle($handle, $style, array $attributes = [])
    {
        if (is_null($handle)) {
            $handle = $style;
        }

        $this->package->css($handle, $style, $attributes);

        return $this;
    }
1334333
function applyStyle($text, $styles = [])
    {
        if (!self::$supported)
            return $text;

        if (is_string($styles))
        {
            $styles = [$styles];
        }

        $output = $text;
        foreach ($styles as $style) {
            if (isset(self::$theme[$style])) {
                $output = $this->applyStyle($output, self::$theme[$style]);
            } else {
                if (isset(self::$styles[$style])) {
                    $pre  = $this->escSequence(self::$styles[$style]);
                    $post = $this->escSequence(0);
                } else {
                    $pre = $post = '';
                }

                $output = $pre . $output . $post;
            }
        }

        return $output;
    }
581974
function (element, style) {
			var styleString = '';

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

			element.setAttribute('style', styleString);

			return element;
		}
263752
public function addById($id, array $styles)
    {
        $this->ids[$id] = array_merge_recursive($this->getById($id), $styles);
    }
869429
public static void updateStyle( ASpatialDb database, Style style ) throws Exception {
        StringBuilder sbIn = new StringBuilder();
        sbIn.append("update ").append(PROPERTIESTABLE);
        sbIn.append(" set ");
        // sbIn.append(NAME).append("='").append(style.name).append("' , ");
        sbIn.append(SIZE).append("=?,");
        sbIn.append(FILLCOLOR).append("=?,");
        sbIn.append(STROKECOLOR).append("=?,");
        sbIn.append(FILLALPHA).append("=?,");
        sbIn.append(STROKEALPHA).append("=?,");
        sbIn.append(SHAPE).append("=?,");
        sbIn.append(WIDTH).append("=?,");
        sbIn.append(LABELSIZE).append("=?,");
        sbIn.append(LABELFIELD).append("=?,");
        sbIn.append(LABELVISIBLE).append("=?,");
        sbIn.append(ENABLED).append("=?,");
        sbIn.append(ORDER).append("=?,");
        sbIn.append(DASH).append("=?,");
        sbIn.append(MINZOOM).append("=?,");
        sbIn.append(MAXZOOM).append("=?,");
        sbIn.append(DECIMATION).append("=?,");
        sbIn.append(THEME).append("=?");
        sbIn.append(" where ");
        sbIn.append(NAME);
        sbIn.append("='");
        sbIn.append(style.name);
        sbIn.append("';");

        Object[] objects = {style.size, style.fillcolor, style.strokecolor, style.fillalpha, style.strokealpha, style.shape,
                style.width, style.labelsize, style.labelfield, style.labelvisible, style.enabled, style.order, style.dashPattern,
                style.minZoom, style.maxZoom, style.decimationFactor, style.getTheme()};

        String updateQuery = sbIn.toString();
        database.executeInsertUpdateDeletePreparedSql(updateQuery, objects);
    }
1058876
public function mapStylesUrlArgs($mapStyleJson)
    {
        $params = [];
        foreach (json_decode($mapStyleJson, true) as $style) {
            $styleString = '';
            if (isset($style['stylers']) && count($style['stylers']) > 0) {
                $styleString .= (isset($style['featureType']) ? ('feature:' . $style['featureType']) : 'feature:all') . '|';
                $styleString .= (isset($style['elementType']) ? ('element:' . $style['elementType']) : 'element:all') . '|';
                foreach ($style['stylers'] as $styler) {
                    $propertyname = array_keys($styler)[0];
                    $propertyval = str_replace('#', '0x', $styler[$propertyname]);
                    $styleString .= $propertyname . ':' . $propertyval . '|';
                }
            }
            $styleString = substr($styleString, 0, strlen($styleString) - 1);
            $params[] = 'style=' . $styleString;
        }

        return implode("&", $params);
    }
725705
private function fillStyleAttributesWithMergedStyles()
    {
        foreach ($this->styleAttributesForNodes as $nodePath => $styleAttributesForNode) {
            $node = $this->visitedNodes[$nodePath];
            $currentStyleAttributes = $this->parseCssDeclarationsBlock($node->getAttribute('style'));
            $node->setAttribute(
                'style',
                $this->generateStyleStringFromDeclarationsArrays(
                    $currentStyleAttributes,
                    $styleAttributesForNode
                )
            );
        }
    }
749679
public function setStyle($style, $column1, $row1, $column2 = null, $row2 = null)
    {
        $this->sheet->getStyleByColumnAndRow($column1, $row1, $column2, $row2)->applyFromArray($style);
    }
1092686
private function mergeValues($a, $b)
    {
        $x = array();
        $y = array();

        if (is_array($a)) {
            $x = $a;
        }

        foreach ($b as $key => $value) {
            $x[$key] = $value;
        }

        return $x;
    }