enqueue css asset to be loaded
@param  [string] $css     [css file to be loaded relative to base_asset_dir]
@param  [array]  $options [location=internal|external, position=first|last|after:file|before:file]
9130
protected function loadCss($css, $options=array())
    {
        $location = (isset($options['location'])) ? $options['location']:'internal';

        //after:file, before:file, first, last
        $position = (isset($options['position'])) ? $options['position']:'last';

        if(!in_array($css,$this->data['css'][$location])){
            if($position=='first' || $position=='last'){
                $key = $position;
                $file='';
            }else{
                list($key,$file) =  explode(':',$position);
            }

            switch($key){
                case 'first':
                    array_unshift($this->data['css'][$location],$css);
                break;

                case 'last':
                    $this->data['css'][$location][]=$css;
                break;

                case 'before':
                case 'after':
                    $varkey = array_keys($this->data['css'][$location],$file);
                    if($varkey){
                        $nextkey = ($key=='after') ? $varkey[0]+1 : $varkey[0];
                        array_splice($this->data['css'][$location],$nextkey,0,$css);
                    }else{
                        $this->data['css'][$location][]=$css;
                    }
                break;
            }
        }
    }
558843
function cssPackage($css, $media = null, $condition = null, $no_build = false) {
        return $this->css('/packages/' . $this->package . '/' . $css, $media, $condition, $no_build);
    }
1309390
function css($css, $media = null, $condition = null, $no_build = false) {
        $this->css[$css] = compact('media', 'condition', 'no_build');
        
        return $this;
    }
533310
public function includeGeneratedCss()
    {
        $filePath = $this->assetHandlerConnectorManager->getFormzGeneratedFilePath() . '.css';

        $this->assetHandlerConnectorManager->createFileInTemporaryDirectory(
            $filePath,
            function () {
                /** @var MessageContainerDisplayCssAssetHandler $errorContainerDisplayCssAssetHandler */
                $errorContainerDisplayCssAssetHandler = $this->assetHandlerConnectorManager
                    ->getAssetHandlerFactory()
                    ->getAssetHandler(MessageContainerDisplayCssAssetHandler::class);

                /** @var FieldsActivationCssAssetHandler $fieldsActivationCssAssetHandler */
                $fieldsActivationCssAssetHandler = $this->assetHandlerConnectorManager
                    ->getAssetHandlerFactory()
                    ->getAssetHandler(FieldsActivationCssAssetHandler::class);

                $css = $errorContainerDisplayCssAssetHandler->getErrorContainerDisplayCss() . LF;
                $css .= $fieldsActivationCssAssetHandler->getFieldsActivationCss();

                return $css;
            }
        );

        $this->assetHandlerConnectorManager
            ->getPageRenderer()
            ->addCssFile(StringService::get()->getResourceRelativePath($filePath));

        return $this;
    }
959229
function processCSSFiles(optionsIn = null, configFileLocationIn = '') {


		var continueCSSFilesProcess = function(optionsIn2){
			// console.log(optionsIn2)
				// console.log(optionsIn2.css)
			CPEVENTS.removeListener('CONFIG_READ_REDUCE_PROPS_END', continueCSSFilesProcess);

			var continueCSSFilesProcessAfterConfig = function(optionsIn3){

				
				CPEVENTS.removeListener('continueCSSFilesProcessAfterConfig', continueCSSFilesProcessAfterConfig);

				//config
				if (OPTIONS.css === undefined && CONFIG.options.css) {
					OPTIONS.css = CONFIG.options.css;
				}

				//Options
				if (optionsIn !== null && optionsIn !== undefined) {

					for (key in optionsIn) {

						OPTIONS[key] = optionsIn[key];	
						
					}
				}
				// console.log(CONFIG)
				// console.log(optionsIn.css)
				// console.log(optionsIn3)
				//CSS Files
				// var files = CONFIG.options.css;

				// if (optionsIn.css !== null && optionsIn.css !== undefined) {

				// files = optionsIn.css;
					
				// }

				files = OPTIONS.css;

				if (files !== undefined && files !== '') {
					tmpCSSPaths = [];

					//check for file or files
					switch (typeof files) {
						case 'object':
						case 'array':
								
							for (i = 0; i < files.length; ++i) {

								getFilePaths(files[i], ['.css']);
							}

							if (tmpCSSPaths.length) {
								files = tmpCSSPaths;
							}

							break;
						case 'string':
							//formats
							files = files.replace(/ /g, '');
							// comma delimited list - filename1.css, filename2.css
							if (files.indexOf(',') > -1) { 
								files = files.replace(/^\s+|\s+$/g,'').split(',');
								
								for (i = 0; i < files.length; ++i) {

									getFilePaths(files[i], ['.css']);

								}

								if (tmpCSSPaths.length) {
									files = tmpCSSPaths;
								}


							} else {

								//string path
								getFilePaths(files, ['.css']);

								if (tmpCSSPaths.length) {
									files = tmpCSSPaths;
								}

							}

							break;
					} //end of switch

					fileLocation = files.toString();

					CPEVENTS.on('CSS_READ_AGAIN', function(){

						readCSSFile(files);
					});
					CPEVENTS.on('CSS_READ_END', function(){
						// CPEVENTS.emit('CONFIG_READ_REDUCE_PROPS_END');
						processCSS(null,OPTIONS,function(){

						});	
						
					});

					readCSSFile(files);


				} else { //end of files nothing check

					//
				}




			};

			if (currentConfig != configFileLocationIn) { //don't read same config
				CPEVENTS.on('CONFIG_READ_END', continueCSSFilesProcessAfterConfig); //end of config read
			}

			currentConfig = configFileLocationIn;

			if (configFileLocationIn != 'cmd_default') {
				readConfig(configFileLocationIn);	
			} else if (configFileLocationIn == 'cmd_default') {
				readConfig(configFileLocationIn, optionsIn);	
			}
		};

		CPEVENTS.on('CONFIG_READ_REDUCE_PROPS_END', continueCSSFilesProcess); //end of reduce config read
		

		if (!hasReadReduceDeclarations && fs.existsSync(OPTIONS.reduce_declarations_file_location)) {
			
			readReduceDeclarations();
		}

		if (!hasReadReduceDeclarations && !fs.existsSync(OPTIONS.reduce_declarations_file_location)) {

			//default process settings
			var default_reduce_declarations_config = {
				"declaration_names" : [
					"font",
					"margin",
					"padding",
					"list-style",
					"outline",
					"border",
					"border-top",
					"border-right",
					"border-bottom",
					"border-left",
					"border-radius",
					"border-color",
					"border-top-color",
					"border-right-color",
					"border-bottom-color",
					"border-left-color",
					"color",
					"background-color",
					"font-color",
					"outline-color",
					"box-shadow",
					"text-shadow",
					"float",
					"font-family",
					"font-size",
					"font-weight",
					"font-style",
					"font-variant",
					"font-stretch"
				]
			};

			if (optionsIn !== null && (optionsIn['reduceConfig'] === undefined || optionsIn['reduceConfig'] === null)) {

				optionsIn['reduceConfig'] = default_reduce_declarations_config;
				readReduceDeclarations(optionsIn['reduceConfig']);
			} else {

				readReduceDeclarations();
			}
		}

	}
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);
        }
891999
protected function _initialize($options = array()) {
		if ($this->_initialized) {
			return;
		}

		$this->_initialized = true;
		if (!empty($options['_css'])) {
			foreach ((array)$options['_css'] as $css) {
				$this->Html->css($css, null, array('inline' => false));
			}
		}

		if (!empty($options['_cssText'])) {
			$out = $this->Html->tag('style', $options['_cssText']);
			$this->_View->append('css', $out);
		}

		if (!empty($options['_scriptBlock'])) {
			$scriptOpts = array('block' => $options['_scriptBlock']);
		} else {
			$scriptOpts = false;
		}

		if (!empty($options['_scripts'])) {
			foreach ((array)$options['_scripts'] as $script) {
				$this->Html->script($script, $scriptOpts);
			}
		}
	}
1138397
public function enqueueStyles($styles)
    {
        // Check styles
        if (empty($styles)) {
            return;
        }

        $defaults = [
            'src'   => false,
            'deps'  => [],
            'ver'   => false,
            'media' => 'all'
        ];

        // Iterate on all
        foreach ($styles as $handle => $opts) {
            if (!is_array($opts)) {
                continue;
            }

            // Merge options with defaults and enqueue style
            $opts = array_merge($defaults, $opts);
            wp_enqueue_style($handle, $opts['src'], $opts['deps'], $opts['ver'], $opts['media']);
        }
    }
12528
public function css($stylesheet = '', $extension = null, $attributes = array())
	{
		$extension = $extension ?: $this->detectExtensionName();

		$attr = array_merge(array(
			'type'    => 'text/css',
			'media'   => null,
			'attribs' => array()
		), $attributes);

		$asset = new Stylesheet($extension, $stylesheet);

		$asset = $this->isSuperGroupAsset($asset);

		if ($asset->exists())
		{
			if ($asset->isDeclaration())
			{
				\App::get('document')->addStyleDeclaration($asset->contents());
			}
			else
			{
				\App::get('document')->addStyleSheet($asset->link(), $attr['type'], $attr['media'], $attr['attribs']);
			}
		}

		return $this;
	}
762989
protected function cacheCssAssetFiles()
    {

        // Cache media asset files
        $this->cacheMediaAssetFiles();

        if ($this->getOptions()->isProduction()) {
            // Retrieve asset file filters manager
            $oAssetFileFiltersManager = $this->getAssetFileFiltersManager();

            // Retrieve Css file filter if available
            $oCssFileFilter = $oAssetFileFiltersManager->has(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS) ? $oAssetFileFiltersManager->get(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS) : null;

            // Create tmp asset file
            $oTmpAssetFile = $this->createTmpAssetFile(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS);

            // Merge less asset files
            foreach ($this->cacheLessAssetFiles() as $oAssetFile) {
                $oTmpAssetFile->setAssetFileContents($this->rewriteAssetFileUrls(
                    // File content
                    $oCssFileFilter ? $oCssFileFilter->filterAssetFile($oAssetFile) : $oAssetFile->getAssetFileContents(),
                    // Current asset file
                    $oAssetFile
                ). PHP_EOL);

                // Remove temp less asset file
                \Zend\Stdlib\ErrorHandler::start();
                unlink($oAssetFile->getAssetFilePath());
                \Zend\Stdlib\ErrorHandler::stop(true);
            }

            // Merge css asset files
            foreach ($this->getAssetFilesConfiguration()->getAssetFiles(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS) as $oAssetFile) {
                $oTmpAssetFile->setAssetFileContents($this->rewriteAssetFileUrls(
                    // File content
                    $oCssFileFilter ? $oCssFileFilter->filterAssetFile($oAssetFile) : $oAssetFile->getAssetFileContents(),
                    // Current asset file
                    $oAssetFile
                ) . PHP_EOL);
            }

             // Cache asset file if not empty
            if($oTmpAssetFile->getAssetFileSize()){
                return array($this->getAssetFilesCacheManager()->cacheAssetFile($oTmpAssetFile));
            }
            return array();
        }

        // Cache less asset files
        $aAssetFiles = $this->cacheLessAssetFiles();

        // Retrieve asset files cache manager
        $oAssetFilesCacheManager = $this->getAssetFilesCacheManager();
        foreach ($this->getAssetFilesConfiguration()->getAssetFiles(\AssetsBundle\AssetFile\AssetFile::ASSET_CSS) as $oAssetFile) {
            // Cache asset file if not empty
            if($oAssetFile->getAssetFileSize()){
                $aAssetFiles[] = $oAssetFilesCacheManager->cacheAssetFile($oAssetFile);
            }
        }
        return $aAssetFiles;
    }
120626
protected function stripExistingCssCharsets($css)
    {
        if (!($css = (string) $css)) {
            return $css; // Nothing to do.
        }
        $css        = preg_replace('/@(?:\-(?:'.$this->regex_vendor_css_prefixes.')\-)?charset(?:\s+[^;]*?)?;/ui', '', $css);
        return $css = $css ? trim($css) : $css;
    }
917333
function loadCss() {
    var cssFileName = fs.path.join(fs.knownFolders.currentApp().path, application.cssFile);

    var applicationCss;
    if (FSA.fileExists(cssFileName)) {
        FSA.readText(cssFileName, function (r) { applicationCss = r; });
        //noinspection JSUnusedAssignment
        application.cssSelectorsCache = styleScope.StyleScope.createSelectorsFromCss(applicationCss, cssFileName);

        // Add New CSS to Current Page
        var f = frameCommon.topmost();
        if (f && f.currentPage) {
            f.currentPage._resetCssValues();
            f.currentPage._styleScope = new styleScope.StyleScope();
            //noinspection JSUnusedAssignment
            f.currentPage._addCssInternal(applicationCss, cssFileName);
            f.currentPage._refreshCss();
        }
    }
}
397716
public static function addCssClass(&$options, $class)
    {
        if (isset($options['class'])) {
            $classes = ' ' . $options['class'] . ' ';
            if (($pos = strpos($classes, ' ' . $class . ' ')) === false) {
                $options['class'] .= ' ' . $class;
            }
        } else {
            $options['class'] = $class;
        }
    }
301797
protected function handleCss(string $task, array $options)
    {
        /** @var Collection $collection */
        $collection = $this->assetsManager->collection($task);

        if (isset($options['files'])) {
            foreach ($options['files'] as $file) {
                $collection->addCss($file, true);
            }
        }

        if (isset($options['join'])) {
            $collection->join((bool)$options['join']);
        }
        if (isset($options['filters'])) {
            foreach ($options['filters'] as $filter) {
                $filterObj = new $filter();
                $collection->addFilter($filterObj);
            }
        }
        if (isset($options['target'])) {
            $collection->setTargetPath($options['target']);
        }

        ob_start();
        $this->assetsManager->outputCss($task);
        ob_end_clean();
    }
960209
public function setCss($css)
    {
        if (is_array($css))
            $css = implode(' ', $css);

        $this->css = $css;

        return $this;
    }
849405
public static function removeCssClass(&$options, $class)
    {
        if (isset($options['class'])) {
            $classes = array_unique(preg_split('/\s+/', $options['class'] . ' ' . $class, -1, PREG_SPLIT_NO_EMPTY));
            if (($index = array_search($class, $classes)) !== false) {
                unset($classes[$index]);
            }
            if (empty($classes)) {
                unset($options['class']);
            } else {
                $options['class'] = implode(' ', $classes);
            }
        }
    }
266393
public static function hasCssClass( $options, $class ) {
		if ( isset( $options['class'] ) ) {
			if ( is_array( $options['class'] ) ) {
				if ( in_array( $class, $options['class'] ) ) {
					return TRUE;
				}
			} elseif ( strpos( $options['class'], $class ) ) {
				return TRUE;
			}
		}

		return FALSE;
	}