Add css or get all css.

@param null $css

@return array|\Illuminate\Contracts\View\Factory|\Illuminate\View\View
508448
public static function css($css = null)
    {
        if (!is_null($css)) {
            return self::$css = array_merge(self::$css, (array) $css);
        }

        if (!$css = static::getMinifiedCss()) {
            $css = array_merge(static::$css, static::baseCss());
        }

        $css = array_filter(array_unique($css));

        return view('admin::partials.css', compact('css'));
    }
767043
public function asset_css($params) {
        if (!isset($params['refs'])) {
            throw new \UnexpectedValueException("The refs parameter is required.");
        }
        $group = isset($params['group']) ? $params['group'] : null;
        $attrs = isset($params['attrs']) ? $params['attrs'] : array();
        $raw = isset($params['raw']) ? $params['raw'] : false;
        return Asset::css($params['refs'], $attrs, $group, $raw);
    }
81056
public static function getCss($name = 'css')
    {
        $output = Load::CSS($GLOBALS[self::$pref.$name]);

        return $output;
    }
278385
public function get($css = null, $compress = true)
    {
        if (null === $css) {
            foreach ((array) $this->_list as $src) {
                if (!file_exists($src)) {
                    continue;
                }

                $css .= file_get_contents($src);
            }
        }

        $this->_list = [];

        return $compress ? $this->parse($css) : $css;
    }
524402
protected function processLogicalOrCss()
    {
        return array_merge(
            $this->toArray($this->leftNode->getCssResult()),
            $this->toArray($this->rightNode->getCssResult())
        );
    }
1076341
public function countSelectors($css = null)
	{
		$count = 0;
		if ($css !== null && $this->css !== $css) {
			$this->css = $css;
			$this->parsedCss = $this->splitIntoBlocks($this->css);
		}
		foreach ($this->parsedCss as $rules) {
			$count += $rules['count'];
		}

		return $count;
	}
475804
protected function process($css)
        {
            $css = str_replace("\r\n", "\n", $css);

            // preserve empty comment after '>'
            // http://www.webdevout.net/css-hacks#in_css-selectors
            $css = preg_replace('@>/\\*\\s*\\*/@', '>/*keep*/', $css);

            // preserve empty comment between property and value
            // http://css-discuss.incutio.com/?page=BoxModelHack
            $css = preg_replace('@/\\*\\s*\\*/\\s*:@', '/*keep*/:', $css);
            $css = preg_replace('@:\\s*/\\*\\s*\\*/@', ':/*keep*/', $css);

            // apply callback to all valid comments (and strip out surrounding ws
            $css = preg_replace_callback(
                '@\\s*/\\*([\\s\\S]*?)\\*/\\s*@',
                array(
                    $this,
                    '_commentCB'
                ),
                $css
            );

            // remove ws around { } and last semicolon in declaration block
            $css = preg_replace('/\\s*{\\s*/', '{', $css);
            $css = preg_replace('/;?\\s*}\\s*/', '}', $css);

            // remove ws surrounding semicolons
            $css = preg_replace('/\\s*;\\s*/', ';', $css);

            // remove ws around urls
            $css = preg_replace('/
                    url\\(      # url(
                    \\s*
                    ([^\\)]+?)  # 1 = the URL (really just a bunch of non right parenthesis)
                    \\s*
                    \\)         # )
                /x',
                'url($1)',
                $css
            );

            // remove ws between rules and colons
            $css = preg_replace('/
                    \\s*
                    ([{;])              # 1 = beginning of block or rule separator
                    \\s*
                    ([\\*_]?[\\w\\-]+)  # 2 = property (and maybe IE filter)
                    \\s*
                    :
                    \\s*
                    (\\b|[#\'"])        # 3 = first character of a value
                /x',
                '$1$2:$3',
                $css
            );

            // remove ws in selectors
            $css = preg_replace_callback('/
                    (?:              # non-capture
                        \\s*
                        [^~>+,\\s]+  # selector part
                        \\s*
                        [,>+~]       # combinators
                    )+
                    \\s*
                    [^~>+,\\s]+      # selector part
                    {                # open declaration block
                /x',
                array(
                    $this,
                    '_selectorsCB'
                ),
                $css
            );

            // minimize hex colors
            $css = preg_replace('/([^=])#([a-f\\d])\\2([a-f\\d])\\3([a-f\\d])\\4([\\s;\\}])/i', '$1#$2$3$4$5', $css);

            // remove spaces between font families
            $css = preg_replace_callback('/font-family:([^;}]+)([;}])/', array($this, '_fontFamilyCB'), $css);

            $css = preg_replace('/@import\\s+url/', '@import url', $css);

            // replace any ws involving newlines with a single newline
            $css = preg_replace('/[ \\t]*\\n+\\s*/', "\n", $css);

            // separate common descendent selectors w/ newlines (to limit line lengths)
            $css = preg_replace('/([\\w#\\.\\*]+)\\s+([\\w#\\.\\*]+){/', "$1\n$2{", $css);

            // Use newline after 1st numeric value (to limit line lengths).
            $css = preg_replace('/
                ((?:padding|margin|border|outline):\\d+(?:px|em)?) # 1 = prop : 1st numeric value
                \\s+
                /x',
                "$1\n",
                $css
            );

            // prevent triggering IE6 bug: http://www.crankygeek.com/ie6pebug/
            $css = preg_replace('/:first-l(etter|ine)\\{/', ':first-l$1 {', $css);

            return trim($css);
        }
648680
private static function fixBackgroundPosition($css) {
		$replaced = preg_replace_callback(
			self::$patterns['bg_horizontal_percentage'],
			array('self', 'calculateNewBackgroundPosition'),
			$css
		);
		if ($replaced !== null) {
			// preg_replace_callback() sometimes returns null
			$css = $replaced;
		}
		$replaced = preg_replace_callback(
			self::$patterns['bg_horizontal_percentage_x'],
			array('self', 'calculateNewBackgroundPosition'),
			$css
		);
		if ($replaced !== null) {
			$css = $replaced;
		}

		return $css;
	}
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;
	}
1196657
protected function getScssVars() {

		$sass = '';

		// Required
		foreach ( $this->requiredSassVars as $var ) {
			$method = $this->varToGetter( $var );

			if ( ! method_exists( $this->input, $method ) ) {
				throw new \LogicException( "Input::{$method}() not found." );
			}
			if ( empty( $this->input->{$method}() ) ) {
				throw new \InvalidArgumentException( "Input::{$method}() cannot be empty." );
			}

			$sass .= "\${$var}: " . $this->input->{$method}() . ";\n";
		}

		// Optional
		foreach ( $this->optionalSassVars as $var ) {
			$method = $this->varToGetter( $var );

			if ( method_exists( $this->input, $method ) && ! empty( $this->input->{$method}() ) ) {
				$sass .= "\${$var}: " . $this->input->{$method}() . ";\n";
			}
		}

		return $sass;
	}
1244353
public function text_first($css)
    {
        $nodes = $this->_document->getQuery()->css($css, $this->_node);
        return $nodes ? $nodes->item(0)->textContent : null;
    }
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;
    }
1281323
public function html_first($css)
    {
        if ($nodes = $this->_document->getQuery()->css($css, $this->_node)) {
            $node = $nodes->item(0);
            return $node->ownerDocument->saveHTML($node);
        } else {
            return null;
        }
    }
556677
protected function minify($css)
	{
		$css = trim($css, " \n\t;");
		$css = preg_replace('(\\s*([,:;])\\s*)', '$1', $css);
		$css = preg_replace_callback(
			'((?<=[\\s:])#[0-9a-f]{3,6})i',
			function ($m)
			{
				return strtolower($m[0]);
			},
			$css
		);
		$css = preg_replace('((?<=[\\s:])#([0-9a-f])\\1([0-9a-f])\\2([0-9a-f])\\3)', '#$1$2$3', $css);
		$css = preg_replace('((?<=[\\s:])#f00\\b)', 'red', $css);
		$css = preg_replace('((?<=[\\s:])0px\\b)', '0', $css);

		return $css;
	}
752381
public function injectHouseStyles( $css ) {

		$scan = [
			'/*__INSERT_PDF_HOUSE_STYLE__*/' => get_theme_root( 'pressbooks-book' ) . '/pressbooks-book/assets/legacy/styles/_pdf-house-style.scss',
			'/*__INSERT_EPUB_HOUSE_STYLE__*/' => get_theme_root( 'pressbooks-book' ) . '/pressbooks-book/assets/legacy/styles/_epub-house-style.scss',
			'/*__INSERT_MOBI_HOUSE_STYLE__*/' => get_theme_root( 'pressbooks-book' ) . '/pressbooks-book/assets/legacy/styles/_mobi-house-style.scss',
		];

		foreach ( $scan as $token => $replace_with ) {
			if ( is_file( $replace_with ) ) {
				$css = str_replace( $token, \Pressbooks\Utility\get_contents( $replace_with ), $css );
			}
		}

		return $css;
	}
1323749
public function get_css($path=''){
    if ( $r = $this->get_view($path, 'css') ){
      return \CssMin::minify($r);
    }
    return false;
  }
549643
protected function style($css, array $attr = null)
    {
        $attr = $this->fixInternalAttr($attr);
        $attr = $this->escaper->attr($attr);
        return "<style $attr>$css</style>";
    }