@param array $styles

@return string
492777
protected function formConditionalStylesOutput($styles)
    {
        $preparedStyles = [];
        $template = '<!--[if %s]><link rel="stylesheet" type="text/css" href="%s"><![endif]-->';
        foreach ($styles as $style => $condition) {
            $preparedStyles[] = sprintf($template, $condition, $style);
        }

        return implode(PHP_EOL, $preparedStyles);
    }
1170381
protected function loadStylesheets(...$styles)
    {
        $files = $this->getFilePayload($styles ?? null);

        if (empty($files)) {
            return;
        }

        foreach ($files as $style) {
            $this->loadStylesheet($style);
        }
    }
1021200
public function createStylesheetPaths(array $stylesheets)
    {
        $sheets = array();

        foreach ($stylesheets as $key => $sheet) {
            if (!$this->isExternalStylesheet($sheet)) {
                // assetic version removal
                $sheet = str_replace(strrchr($sheet, 'css?'), 'css', $sheet);
                $sheet = $this->getBasePath() . $sheet;
            }

            $sheets[] = $sheet;
        }

        return $sheets;
    }
1327689
public function flat(array $properties): string
    {
        Assert::isMap($properties);

        return $this->arrayImploder->byGlue($properties, ';', ':');
    }
213987
public function formatAttributes(array $attributes) {
        foreach ($attributes as $key => $attr) {
            if ($attr instanceof Closure) {
                $attributes[$key] = call_user_func($attr, $this);

            } else if ($this->hasKeyword($attr)) {
                $attributes[$key] = $this->getKeyword($attr);

            } else if ($attr === true) {
                $attributes[$key] = $this->getKeyword($key);

            } else {
                $attributes[$key] = (string) $attr;
            }
        }

        return $attributes;
    }
629
protected function get_html_attributes( array $attributes ) {
		$html_attributes = '';
		if ( ! empty( $attributes ) ) {
			foreach ( $attributes as $attr => $val ) {
				$html_attributes .= \esc_attr( $attr ) . '="' . \esc_attr( $val ) . '" ';
			}
		}

		return $html_attributes;
	}
292723
public function parseStylesheet($stylesheet)
    {
        $parsed = array();
        $stylesheet = $this->_stripStylesheet($stylesheet);
        $stylesheet = trim(trim($stylesheet), "}");
        foreach(explode("}", $stylesheet) as $rule) {
            //Don't parse empty rules
        	if(!trim($rule))continue;
        	list($selector, $style) = explode("{", $rule, 2);
            foreach (explode(',', $selector) as $sel) {
                $parsed[] = array(trim($sel), trim(trim($style), ";"));
            }
        }

        return $parsed;
    }
959884
public function svgSetStyle($styles)
    {
        // init the PDF style
        $style = '';

        // Style : fill
        if ($styles['fill']) {
            $this->setFillColorArray($styles['fill']);
            $style.= 'F';
        }

        // Style : stroke
        if ($styles['stroke'] && $styles['stroke-width']) {
            $this->SetDrawColorArray($styles['stroke']);
            $this->SetLineWidth($styles['stroke-width']);
            $style.= 'D';
        }

        // Style : opacity
        if ($styles['fill-opacity']) {
            $this->SetAlpha($styles['fill-opacity']);
        }

        return $style;
    }
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);
    }
312688
protected function formStylesOutput($styles)
    {
        $preparedStyles = [];
        $template = '<link rel="stylesheet" type="text/css" href="%s" />';
        foreach ($styles as $style) {
            $preparedStyles[] = sprintf($template, $style);
        }

        return implode(PHP_EOL, $preparedStyles);
    }
533599
public function replaceCssPaths(array $links)
    {
        foreach ($links as $key => $link) {
            if (!$this->isExternalStylesheet($link)) {
                $links[$key] = $this->getUrl() . $link;
            }
        }

        return $links;
    }
1206721
private function getRawHeaders(array $headers)
    {
        $rawHeaders = '';
        foreach ($headers as $key => $value) {
            $rawHeaders .= sprintf("%s: %s\n", $key, is_array($value) ? implode(', ', $value) : $value);
        }
        $rawHeaders .= "\n";

        return $rawHeaders;
    }
426229
public function getStyles($names = [])
    {
        $styles = [];
        
        foreach ($names as $name) {
            $styles[] = $this->getStyle($name);
        }
        
        return array_filter($styles);
    }
1368857
public function buildRowStyle(array $style)
    {
        $finalStyle = new StyleBuilder();

        // Spout doesn't offer support for changing column alignment.

        if (array_key_exists('font', $style)) {
            if (array_key_exists('color', $style['font'])) {
                $finalStyle->setFontColor(
                    Color::toARGB($style['font']['color']['rgb'])
                );
            }

            if (array_key_exists('bold', $style['font']) && ($style['font']['bold'] === true)) {
                $finalStyle->setFontBold();
            }
        }

        return $finalStyle->build();
    }
549937
public function style($style)
    {
        if (is_array($style)) {
            $style = implode('; ', array_map(function ($value, $attribute) {
                return "{$attribute}: {$value}";
            }, $style, array_keys($style)));
        }

        return $this->attribute('style', $style);
    }
643534
public function rules($styles)
	{
		// Remove comments.
		$comment = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $styles);

		// Make it into one long line.
		$lineCss = str_replace(["\n", "\r"], '', $comment);

		// Replace all multiple spaces by one space.
		$spaces  = preg_replace('!\s+!', ' ', $lineCss);

		// Replace some unneeded spaces, modify as needed.
		$rules   = [' {', ' }', '{ ', '} ', '; ', ';}', ': ', ', ', ' 0.', '.0%', '-0.', '.0rem', '.0em', '.0px', ':0.'];
		$replace = ['{' , '}' , '{' , '}' , ';' , '}' , ':' , ',' , ' .' , '%'  , '-.' , 'rem'  , 'em'  , 'px'  , ':.' ];

		// Output processed styles.
		$output  = str_replace($rules, $replace, $spaces);
		return $output;
	}
1196538
public static function arrayToCss($array){
        $css = '';

        // rebuild CSS
        foreach($array as $key1 => $value1){
            $css .= $key1 . '{';

            foreach($value1 as $key2 => $value2){
                // in the case that the code is embedded in a media query
                if(is_array($value2)){
                    foreach($value2 as $value3){
                        $css .= $key2 . '{';
                        foreach($value3 as $mProp){
                            $css .= $mProp . ':' . $value3 . ';';
                        }
                        $css .= '}';
                    }
                }
                // regular selectors
                else{
                    $css .= $key2 . ':' . $value2 . ';';
                }
            }
            $css .= "}\n";
        }
        return $css;
    }