Get the whole css stylesheet for editor iframe.

NOTE: this method is not expected to be used from any addons.

@return string CSS markup
335298
public function get_css_content_editor() {
        $css = '';
        $cssfiles = $this->editor_css_files();

        // If editor has static CSS, include it.
        foreach ($cssfiles as $file) {
            $css .= file_get_contents($file)."\n";
        }

        // If editor has SCSS, compile and include it.
        if (($convertedscss = $this->editor_scss_to_css())) {
            $css .= $convertedscss;
        }

        $output = $this->post_process($css);

        return $output;
    }
591942
public function renderLegacyCss()
    {
        $cssFiles = [];
        $cssCodeLines = [];

        foreach ($this->legacyHelper->get('css_files', []) as $cssItem) {
            // List of items can contain empty elements, path to files or code
            if (!empty($cssItem)) {
                if (isset($cssItem[5]) && $this->isFile($cssItem, '.css')) {
                    $cssFiles[] = $cssItem;
                } else {
                    $cssCodeLines[] = $cssItem;
                }
            }
        }

        return $this->environment->render(
            $this->cssTemplate,
            [
                'css_files' => $cssFiles,
                'css_code_lines' => $cssCodeLines,
            ]
        );
    }
1272764
public function getViewportHTML()
    {
        $added_data = array(
            'handle',
            'name',
            'brand',
            'width',
            'height',
            'ratio',
            'agent', );

        $datas = array();
        foreach ($added_data as $key) {
            $datas[] = sprintf('data-device-%s="%s"', $key, h($this->{$key}));
        }

        return sprintf(
            '<div class="ccm-device-viewport" %s style="width:%spx;height:%spx">%s</div>',
            implode(' ', $datas),
            floor($this->getWidth() / $this->getPixelRatio()),
            floor($this->getHeight() / $this->getPixelRatio()),
            '<iframe class="ccm-display-frame"></iframe>');
    }
1166022
public function renderCss()
    {
        $cssFileList = $this->getCssFileList();

        if ($cssFileList->count() == 0) {
            return '';
        }

        $generate   = true;
        $bundlePath = $this->getCssBundlePath();

        if (!$this->getForce() && file_exists($bundlePath)) {
            $cacheTime = filemtime($bundlePath);

            if (false !== $cacheTime && $cacheTime >= $cssFileList->getMaxMTime()) {
                $generate = false;
            }
        }

        $bundleUrl = $this->getCssBundleUrl();

        if ($generate) {
            $data   = '';
            $filter = $this->getCssFilter();

            foreach ($cssFileList as $file => $fileInfo) {
                $data .= '/* --------- ' . $file . ' --------- */' . PHP_EOL;
                $contents = @file_get_contents($fileInfo->getPathname());
                if (!$contents) {
                    $data .= '/* FILE READ ERROR! */' . PHP_EOL;
                } else {
                    if (null !== $filter) {
                        $contents = $filter->filterFile($contents, $file, $fileInfo, $bundleUrl, $bundlePath);
                    }

                    $data .= $contents . PHP_EOL;
                }
            }

            if (null !== $filter) {
                $data = $filter->filter($data);
            }

            $cacheTime = $this->writeBundleFile($bundlePath, $data);
        }

        $template = $this->getCssTemplate();

        if (is_callable($template)) {
            return call_user_func($template, $bundleUrl, $cacheTime, $this->getRenderAsXhtml());
        }

        return sprintf(
            $template,
            $bundleUrl,
            $cacheTime,
            $this->getRenderAsXhtml() ? ' /' : ''
        );
    }
792986
public function get_styles() {

		$styles = null;

		foreach ( $this->configs as $config_id => $args ) {

			if ( true === $this->is_disabled( $args ) ) {
				continue;
			}

			$modules_css = $this->modules_css;
			$styles      = $modules_css::loop_controls( $config_id ); // phpcs:ignore PHPCompatibility.Syntax.NewDynamicAccessToStatic
			$styles      = apply_filters( "kirki_gutenberg_{$config_id}_dynamic_css", $styles );

			if ( empty( $styles ) ) {
				continue;
			}
		}

		return $styles;
	}
313506
protected function getStyleSheet() {
        if (!$this->_styleSheet) {
            $this->_styleSheet = new StyleSheetList($this->version, $this->solution['sid']);
        }

        return $this->_styleSheet;
    }
386755
public function get_inline_css() {
		if ( $this->get_pre_selectors() ) {
			$inline_css = sprintf(
				'%1$s { %2$s }',
				implode( ',', $this->get_selectors() ),
				$this->get_properties()
			);
			foreach ( $this->get_pre_selectors() as $pre_selector ) {
				$inline_css = sprintf(
					'%1$s { %2$s }',
					$pre_selector,
					$inline_css
				);
			}
			return $inline_css;
		}

		return sprintf(
			'%1$s { %2$s }',
			implode( ',', $this->get_selectors() ),
			$this->get_properties()
		);
	}
774444
public function formGroupCssClass()
    {
        if (empty($this->formGroupCssClass)) {
            $this->formGroupCssClass = $this->defaultFormGroupCssClasses();
        }

        return implode(' ', $this->formGroupCssClass);
    }
834067
public function getCss(){

		$precision = ini_get('precision');
		@ini_set('precision',16);
		$locale = setlocale(LC_NUMERIC, 0);
		setlocale(LC_NUMERIC, "C");

		try {

	 		$root = new Less_Tree_Ruleset(array(), $this->rules );
			$root->root = true;
			$root->firstRoot = true;


			$this->PreVisitors($root);

			self::$has_extends = false;
			$evaldRoot = $root->compile($this->env);



			$this->PostVisitors($evaldRoot);

			if( Less_Parser::$options['sourceMap'] ){
				$generator = new Less_SourceMap_Generator($evaldRoot, Less_Parser::$contentsMap, Less_Parser::$options );
				// will also save file
				// FIXME: should happen somewhere else?
				$css = $generator->generateCSS();
			}else{
				$css = $evaldRoot->toCSS();
			}

			if( Less_Parser::$options['compress'] ){
				$css = preg_replace('/(^(\s)+)|((\s)+$)/', '', $css);
			}

		} catch (Exception $exc) {
			// Intentional fall-through so we can reset environment
		}

		//reset php settings
		@ini_set('precision',$precision);
		setlocale(LC_NUMERIC, $locale);

		// If you previously defined $this->mb_internal_encoding
		// is required to return the encoding as it was before
		if ($this->mb_internal_encoding != '') {
			@ini_set("mbstring.internal_encoding", $this->mb_internal_encoding);
			$this->mb_internal_encoding = '';
		}

		// Rethrow exception after we handled resetting the environment
		if (!empty($exc)) {
			throw $exc;
		}



		return $css;
	}
332911
public function getStylesheets()
    {
        $parse_stylesheets = function ($params, $stylesheets) {
            foreach ($params as $css) {
                if (is_string($css)) {
                    $css = array(
                        'path' => $css,
                        'media' => 'all',
                    );
                }

                $stylesheets[] = $css;
            }

            return $stylesheets;
        };

        // From config.yml
        $stylesheets = $parse_stylesheets(
            $this->getGenerator()->getFromBundleConfig('stylesheets', array()), array()
        );

        // From generator.yml
        $stylesheets = $parse_stylesheets(
            $this->getVariable('stylesheets', array()), $stylesheets
        );

        return $stylesheets;
    }
936449
public function getCustomCSSAsString()
    {
        // Create CSS Array:
        
        $css = [];
        
        // Merge Custom CSS from Page Controller:
        
        if ($this->owner instanceof PageController) {
            $css = array_merge($css, $this->owner->getCustomCSS());
        }
        
        // Create CSS String:
        
        $css = implode("\n", $css);
        
        // Remove Empty Lines:
        
        $css = ViewTools::singleton()->removeEmptyLines($css);
        
        // Trim CSS String:
        
        $css = trim($css);
        
        // Minify CSS String:
        
        if (!Director::isDev()) {
            $css = ViewTools::singleton()->minifyCSS($css);
        }
        
        // Answer CSS String:
        
        return $css;
    }
284321
public function renderStyles()
    {
        $this->loadPackageCss();

        if (empty($this->styles)) {
            return PHP_EOL;
        }

        $assets = [];

        foreach ($this->sort($this->styles) as $handle => $data) {
            $assets[] = $this->getCss($handle);
        }

        return implode(PHP_EOL, $assets);
    }
1370581
public function renderCss()
	{
		$result = "";
		$css = $this->getCss();
		if(!empty($css))
		array_walk($css, function($value) use (&$result){
			$result .= '<link href="'.$value.'" type="text/css" rel="stylesheet">';
		});
		$custom = $this->getCustomCss();
		if(!empty($custom))
		{
			$customCss = '<style type="text/css" rel="stylesheet" id="silex-assets-service-css-'.substr(md5(time()),0,5).'">';
			if($custom !== array())
				array_walk($custom, function($value) use (&$customCss){
					$customCss .= $value."\n";
				});
			$customCss .= "</style>";
			$result .= $customCss;
		}
		return $result;
	}
902760
public function getCss()
	{
		$css = $this->css;
		$options = $this->options;
		if($this->isCombineEnabled())
			$this->combine('css', $css);

		// avoiding duplicate assets
		$css = array_flip(array_flip($css));

		array_walk($css, function(&$value) use($options){
			if(!empty($options['baseUrl'])&&strpos($value,'http://')===false)
				$value = $options['baseUrl'].$value;
		});
		return $css;
	}
1137249
public function getCss()
    {
        switch ($this->type) {
            case self::TYPE_ERROR:
                $css = 'danger';
                break;
            case self::TYPE_WARNING:
                $css = 'warning';
                break;
            case self::TYPE_INFO:
                $css = 'info';
                break;
            case self::TYPE_SUCCESS:
                $css = 'success';
                break;
            default:
                $css = 'info';
                break;
        }

        return $css;
    }
300134
public function getContentCSS()
    {
        // Prioritise instance specific content
        if (isset($this->contentCSS)) {
            return $this->contentCSS;
        }

        // Add standard editor.css
        $editor = [];
        $editorCSSFiles = $this->config()->get('editor_css');
        if ($editorCSSFiles) {
            foreach ($editorCSSFiles as $editorCSS) {
                $editor[] = $editorCSS;
            }
        }

        // Themed editor.css
        $themes = HTMLEditorConfig::getThemes() ?: SSViewer::get_themes();
        $themedEditor = ThemeResourceLoader::inst()->findThemedCSS('editor', $themes);
        if ($themedEditor) {
            $editor[] = $themedEditor;
        }
        return $editor;
    }
783071
protected function getAddonCssClass()
	{
		$classes = array();
		if (isset($this->prependText))
			$classes[] = 'input-prepend';
		if (isset($this->appendText))
			$classes[] = 'input-append';

		return implode(' ', $classes);
	}