Manages all known CSS that can be handled through CDNs

@param string $cssFileName
@return array|string
437547
protected function setCssFileCDN($cssFileName)
    {
        $patternFound = null;
        if (strpos(pathinfo($cssFileName)['basename'], 'font-awesome-') !== false) {
            $patternFound = $this->setCssFileCDNforFontAwesome($cssFileName);
        }
        if (is_null($patternFound)) {
            $patternFound = [false, $this->sanitizeString($cssFileName)];
        }
        return $patternFound;
    }
65492
public function setCssFile($cssFile)
    {
        if (!$this->cssFileIsCached($cssFile)) {
            $absoluteFileName = GeneralUtility::getFileAbsFileName($cssFile);
            if (($cssFile !== '') && is_readable($absoluteFileName)
            ) {
                self::$cssFileCache[$cssFile] = file_get_contents($absoluteFileName);
            } else {
                self::$cssFileCache[$cssFile] = '';
            }
        }

        $this->setAsString('cssFile', self::$cssFileCache[$cssFile]);
    }
198536
public function process($filename, $actualFileName)
    {
        // Check if the processing should be done
        if(!$this->shouldProcess($filename))
        {
            // No need to process the file, so bypass
            return $this->getFinalName($filename);
        }

        // Get an instance of the SASS compiler
        $sass = new \scssc();

        // Otherwise write the file and return the new file name
        return $this->write($sass->compile(file_get_contents($filename)), $actualFileName);
    }
744170
public function css($filename)
    {
        $ds = DIRECTORY_SEPARATOR;

        $filename = (isset($this->assetPaths['css']) ? $this->assetPaths['css'].'/' : '').$filename;

        $filepath = $this->refinePath($this->basePath.$ds.$filename);

        return new Asset($this->urlFactory, 'css', $filepath, $filename, $this->persistable);
    }
610201
protected function parseFileName($fileName)
    {
        return preg_replace_callback('#(\[.*\])#U', function ($matches) {
            $format = str_replace(['[',']'], [], $matches[1]);

            return $this->now->format($format);
        }, $fileName);
    }
1307312
private function applyCssRules($files, $name)
	{
		$css = '';
		foreach ($files as $file) {
			$css .= file_get_contents($file);
		}
		$contents = file_put_contents($name, $this->rules->rules($css));
		return $contents;
	}
1248311
public function getFilePath($fileName = null)
    {
        if ($fileName === null) {
            $fileName = $this->fileName;
        }

        $component = $this->component;
        $path = $component->getPath().'/'.$fileName;

        /*
         * Check the shared "/partials" directory for the partial
         */
        if (!File::isFile($path)) {
            $sharedDir = dirname($component->getPath()).'/partials';
            $sharedPath = $sharedDir.'/'.$fileName;
            if (File::isFile($sharedPath)) {
                return $sharedPath;
            }
        }

        return $path;
    }
1230824
public function addCSS($filename)
    {
        if (($css = @file_get_contents($filename)) === false) {
            throw new \Exception('Invalid css file path provided.');
        }
        $this->css .= $css;
    }
738620
public function css(array $files, $outputFile)
    {
        if ($this->production) {
            return '<link rel="stylesheet" href="' . $outputFile . '">';
        }

        $this->minify($files, $outputFile, $this->cssMinifiers);

        $stylesheets = [];

        foreach ($files as $file) {
            $stylesheets[] = '<link rel="stylesheet" href="' . $file . '">';
        }

        return implode("\n", $stylesheets);
    }
61306
protected function getCssAsset(string $filename, string $newExtension): string
    {
        $extensionlessFilename = pathinfo($filename, PATHINFO_FILENAME);
        /** @var int $filenamePosition */
        $filenamePosition = strrpos($filename, $extensionlessFilename);
        $relativePath = substr($filename, 0, $filenamePosition);
        return "$relativePath$extensionlessFilename.$newExtension";
    }
939291
protected function _getFromCSS()
    {
        // styles to apply
        $styles = array();

        // list of the selectors to get in the CSS files
        $getit  = array();

        // get the list of the selectors of each tags
        $lst = array();
        $lst[] = $this->value['id_lst'];
        for ($i=count($this->table)-1; $i>=0; $i--) {
            $lst[] = $this->table[$i]['id_lst'];
        }

        // foreach selectors in the CSS files, verify if it match with the list of selectors
        foreach ($this->cssKeys as $key => $num) {
            if ($this->_getReccursiveStyle($key, $lst)) {
                $getit[$key] = $num;
            }
        }

        // if we have selectors
        if (count($getit)) {
            // get them, but in the definition order, because of priority
            asort($getit);
            foreach ($getit as $key => $val) $styles = array_merge($styles, $this->css[$key]);
        }

        return $styles;
    }
221295
protected function _filterCssFile($fileName)
    {
        try {
            //pobranie kontentu
            $content = file_get_contents(BASE_PATH . '/web/' . $fileName);
        } catch (\Exception $e) {
            return '/* CSS file not found: ' . $fileName . ' */';
        }
        //lokalizacja zasobów z uwzględnieniem baseUrl
        $location = $this->view->baseUrl . '/' . trim(dirname($fileName), '/') . '/';
        //usuwanie nowych linii i tabów
        return preg_replace(['/\r\n/', '/\n/', '/\t/'], '', str_replace(['url(\'', 'url("'], ['url(\'' . $location, 'url("' . $location], $content));
    }
1037371
public function css($css) {
        $css = trim($css);
        if (substr($css, -1) !== ';') {
            $css = $css . ';';
        }
        return $this->att(['style' => $css]);
    }
299894
public function toFile( $fileName ){
		$css	= FS_File_CSS_Converter::convertSheetToString( $this->sheet );
		return FS_File_Writer::save( $fileName, $css );
	}
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,
            ]
        );
    }
1319357
public function assetPath($fileName, array $options = [])
    {
        if ($this->isRelativePath($fileName)) {
            if (substr($fileName, 0, 1) == '/') {
                $path = $fileName;
            } else {
                $path = '';
                
                if ($this->config['serve_static_assets']) {
                    $path = $this->getStaticAssetUrl($fileName);
                }
                
                if (!$path) {
                    $file = $this->getService('assets')->findFile($fileName);
                    if (!$file) {
                        $path = $this->defaultPath($fileName, $options);
                    } else {
                        $path = $file->url();
                    }
                }
            }
            
            return $this->properPath($path, $options);
        } else {
            return $fileName;
        }
    }
513990
public function cmsPageCss()
    {
        $currentView = $this->currentViewHelper->getCurrentView();
        if (!$currentView || !$this->viewCssBuilder->cssFileExists($currentView)) {
            return '<!-- CSS File not found -->';
        }

        return sprintf(
            '<link href="%s" rel="stylesheet" type="text/css" rel="stylesheet"/>',
            $this->viewCssBuilder->getHref($currentView)
        );
    }