Process CSS for the docs.
@returns {PassThrough} A source stream.
969447
function stylesDocs() {
  return gulp.src( 'docs/src/css/main.less' )
    .pipe( gulpLess( {
      paths: [ 'node_modules/cf-*/src/' ],
      compress: true
    } ) )
    .pipe( gulpPostcss( [
      autoprefixer( {
        browsers: BROWSER_LIST.LAST_2_PLUS_IE_8_AND_UP
      } )
    ] ) )
    .pipe( gulp.dest( 'docs/dist/css/' ) );
}
1101432
function stylesheet(config = {}) {
	const minifier = new cleancss();
	const styles = [];

	return {
		name: 'stylesheet',
		transform(code, id) {
			// Note that 'id' can be mapped to a CJS proxy import, in which case
			// 'id' will start with 'commonjs-proxy', so let's first check if we
			// are importing an existing css file (i.e. startsWith()).
			if (!id.startsWith(path.resolve('.')) || !id.endsWith('.css')) {
				return;
			}

			if (config.minify) {
				code = minifier.minify(code).styles;
			}

			// keep track of all imported stylesheets (already minified)
			styles.push(code);

			return {
				code: 'export default ' + JSON.stringify(code)
			};
		},
		generateBundle(opts, bundle) {
			if (!config.extract) {
				return;
			}

			const entry = Object.keys(bundle).find(v => bundle[v].isEntry);
			const name = (entry || '').replace(/\.js$/i, '.css');
			if (!name) {
				this.error('failed to guess the output file name');
			}

			bundle[name] = {
				code: styles.filter(v => !!v).join('')
			};
		}
	};
}
390742
function() {
  var src = config.paths.src;
  var out = config.paths.out;

  src.base = src.base || 'src/';
  src.styles = src.styles || 'styles/';
  src.scripts = src.scripts || 'scripts/';
  src.esnextExtension = src.esnextExtension || '.es6';
  src.views = src.templates || '../views/';
  src.partials = src.partials !== null ? src.partials : 'partials/';

  out.base = out.base || 'public/';

  var processed = {
    src: {
      styles: src.base + src.styles + '**/*' + plugins.styles.ext,
      scripts: src.base + src.scripts,
      es6: src.base + src.scripts + '**/*' + src.esnextExtension,
      esnextExt: src.esnextExtension,
      js: src.base + src.scripts + '**/*.js',
      views: src.base + src.views + '**/*',
      partials: src.base + src.views + src.partials + '**/*' + plugins.tpls.ext,
      tmp: src.base + 'temp/'
    },
    out: {
      base: out.base,
      styles: out.base + (out.styles || 'css/'),
      js: out.base + (out.scripts || 'js/')
    }
  };

  return processed;
}
1045354
function processContentWithPostCSS(options, href) {
	/**
	 * @param  {String} content [css to process]
	 * @return {Object}         [object with css tokens and css itself]
	 */
	return function (content) {
		if (options.generateScopedName) {
			options.generateScopedName = typeof options.generateScopedName === 'function' ?
				/* istanbul ignore next */
				options.generateScopedName :
				genericNames(options.generateScopedName, {context: options.root});
		} else {
			options.generateScopedName = function (local, filename) {
				return Scope.generateScopedName(local, path.relative(options.root, filename));
			};
		}

		// Setup css-modules plugins 💼
		var runner = postcss([
			Values,
			LocalByDefault,
			ExtractImports,
			new Scope({generateScopedName: options.generateScopedName}),
			new Parser({fetch: fetch})
		].concat(options.plugins));

		function fetch(_to, _from) {
			// Seems ok 👏
			var filePath = normalizePath(_to, options.root, _from);

			return new Promise(function (resolve, reject) {
				return fs.readFile(filePath, 'utf8', function (err, content) {
					/* istanbul ignore next: just error handler */
					if (err) {
						return reject(err);
					}

					return runner.process(content, {from: filePath})
						.then(function (result) {
							return resolve(result.root.tokens);
						}).catch(reject);
				});
			});
		}

		return runner.process(content, {from: normalizePath(href, options.root, options.from)});
	};
}
835358
function processStylesheet(ss) {
      // cssRules respects same-origin policy, as per
      // https://code.google.com/p/chromium/issues/detail?id=49001#c10.
      try {
        if (!ss.cssRules) { return; }
      } catch (e) {
        if (e.name !== 'SecurityError') { throw e; }
        return;
      }
      // ss.cssRules is available, so proceed with desired operations.
      var rules = [];
      for (var i = 0; i < ss.cssRules.length; i++) {
        var rule = ss.cssRules[i];
        rules.push(rule);
      }
      return rules;
    }
97207
function processFile(rootPath, preprocessor) {
  return (file, callback) => {
    if (preprocessor === StylePreprocessor.LESS) {
      const options = { paths: [rootPath], syncImport: true };
      less.render(file.data, options, (error, output) => {
        if (error) {
          console.error(`${file.path}: Could not render the LESS styles`);
          async.nextTick(callback, error);
          return;
        }

        const data = output.css;
        async.nextTick(callback, null, Object.assign({}, file, { data }));
      });
    } else {
      async.nextTick(callback, null, file);
    }
  };
}
963910
function(css) {
  css = css
    // remove comments
    .replace(/\/\*[^\0]*?\*\//g, '')
    // trim space before characters
    .replace(/\s+({|})/g, '$1')
    // trim space after characters
    .replace(/(;|,|:|{|}|^)\s+/g, '$1')
    // trim combinators
    .replace(/\s+(>|\+|~)\s+/g, '$1')
    // remove escaped newlines and spaces
    .replace(/\\\r?\n\s+/g, '')
    // remove trailing semicolons in rules
    .replace(/;(})/g, '$1');

  return css;
}
57691
protected function getCssResource()
    {
        $handle = fopen("php://memory", "rw");
        fputs($handle, $this->getPreparedCssContent());
        rewind($handle);

        return $handle;
    }
337125
function createScssPreprocessor(args, config = {}, logger) {
  const log = logger.create('preprocessor.scss');

  // Options. See https://www.npmjs.com/package/node-sass for details
  const options = merge({
    sourceMap: false,
    transformPath(filepath) {
      return filepath.replace(/\.scss$/, '.css');
    },
  }, args.options || {}, config.options || {});

  return function processFile(content, file, done) {
    let result = null;

    log.debug('Processing "%s".', file.originalPath);

    // Transform file.path to .css so Karma serves it as a stylesheet
    file.path = file.originalPath.replace(/\.scss$/, '.css'); // eslint-disable-line

    // Clone the options because we need to mutate them
    const opts = clone(options);

    // Add current file's directory into include paths
    opts.includePaths = [path.dirname(file.originalPath)].concat(opts.includePaths || []);

    // Inline source maps
    if (opts.sourceMap) {
      opts.sourceMap = file.path;
      opts.omitSourceMapUrl = true;
    }

    // Compile using node-sass (synchronously)
    try {
      opts.file = file.originalPath;
      result = sass.renderSync(opts);
    } catch (error) {
      const message = formattedScssMessage(error, file);
      log.error('%s\n  at %s:%d', message, file.originalPath, error.line);
      error.message = stripAnsi(message);
      return done(error, null);
    }

    done(null, result.css || result);
    return undefined;
  };
}
1353019
function completeOutput(outputCSS = '') {


		if (OPTIONS.css_output !== '') {
			// console.log(outputCSS)


			//write output
			try {
				if (OPTIONS.format_4095_rules_legacy_limit) {
					// console.log(summary.stats.after.noRules)
					var noOutputFilesNeeded = Math.ceil(summary.stats.after.noRules / 4095);
					// console.log(noOutputFilesNeeded)
					

					if (noOutputFilesNeeded == 1) {

						outputCSS = trimCSS(outputCSS);
						outputCSS = restoreHacks(outputCSS);
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					} else { //group 4095 rules

						try {
							var ast = css.parse(outputCSS, { source: fileLocation });
						} catch(err) {
							console.log(error("CSS Parser2 Error: probably have something funny in your CSS, change it then please try again."));
							console.log('Reason: ' + err.reason);
							console.log('Line: ' + err.line);
							console.log('Column: ' + err.column);
							console.log('Filename: ' + err.filename);
							process.exit(1);
						}

						var rulesGroups = [];
						var rulesGroupsLen = 0;
						var rules = ast.stylesheet.rules;
						var ruleslen = rules.length;
						var ruleCount = 0;
						var groupCount = 0;

						for (i = 0; i < ruleslen; ++i) {

							if (rulesGroups[groupCount] === undefined) {
								rulesGroups[groupCount] = [];
							}
							rulesGroups[groupCount].push(rules[i]);
							ruleCount += 1;

							if (ruleCount == 4095) {
								groupCount += 1;
							}
						}
						rulesGroupsLen = rulesGroups.length;
						filesizeKB = 0;
						outputFilename = '';
						for (i = 0; i < rulesGroupsLen; i++) {

							outputAST = {
								type: 'stylesheet',
								stylesheet: {
									rules: rulesGroups[i]
								}
							};
							outputCSS = css.stringify(outputAST);

							outputCSS = trimCSS(outputCSS);
							outputCSS = restoreHacks(outputCSS);
							outputFilename = OPTIONS.css_output.substr(0, OPTIONS.css_output.length-4) + '_' + i + '.css';
							write(outputFilename, outputCSS);

							filesizeKB += getFilesizeInKiloBytes(outputFilename);
						}
					}
					
				} else {
					outputCSS = trimCSS(outputCSS);
					outputCSS = restoreHacks(outputCSS);
					if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
						var size = kiloByteLength(outputCSS);
						filesizeKB = size/1000;
					} else {
						write(OPTIONS.css_output, outputCSS);
						filesizeKB = getFilesizeInKiloBytes(OPTIONS.css_output);
					}
				}
				
			} catch(e) {
				console.log(error("Output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}

		} else {
			outputCSS = trimCSS(outputCSS);
			outputCSS = restoreHacks(outputCSS);
			filesizeKB = kiloByteLength(outputCSS);
		}

		summary.stats.after.totalFileSizeKB += filesizeKB;
		summary.stats.summary.savingsKB = roundTo(summary.stats.before.totalFileSizeKB - summary.stats.after.totalFileSizeKB, 4);
		summary.stats.summary.savingsPercentage = roundTo(summary.stats.summary.savingsKB / summary.stats.before.totalFileSizeKB * 100, 2);

		//write report
		if (OPTIONS.generate_report) {

			try {
				var cssdata = JSON.stringify(summary, null, '\t');
				write(REPORT_DUPLICATE_CSS, JSON.stringify(summary, null, '\t'));
			} catch(e) {
				console.log(error("Report output file error: Something went wrong while writing the file, check your folder permissions, config_css.json and please try again."));
				console.log(e);
				process.exit(1);
			}
		}

		if (OPTIONS.verbose) {

			console.log(cool('Before: ' + summary.stats.before.totalFileSizeKB + 'KB'));
			console.log(cool('After: ' + summary.stats.after.totalFileSizeKB + 'KB'));
			console.log(cool('Saved: ' + summary.stats.summary.savingsKB + 'KB (' + summary.stats.summary.savingsPercentage + '%)'));

			console.timeEnd(logoRed("Purged " + timeLabel + " in "));
		}

		if (OPTIONS.css_output === null || OPTIONS.css_output === undefined || OPTIONS.css_output == '') {
			return outputCSS;
		} else {

			// console.log(OPTIONS.css_output);
			
		}
	}
1114279
function getCSSTransitionString(element) {
                    var transitionStr = VENDORS._cssProperty('transition');
                    var assembledValue = element.css(transitionStr);
                    if(assembledValue)
                        return assembledValue;
                    var regExpString = '\\s*(' + '([^,(]+(\\(.+?\\))?)+' + ')[\\s,]*';
                    var regExpMain = new RegExp(regExpString);
                    var regExpValidate = new RegExp('^(' + regExpString + ')+$');
                    var properties = 'property duration timing-function delay'.split(' ');
                    var result = [ ];
                    var strResult;
                    var valueArray;
                    var i = 0;
                    var j;
                    var splitCssStyleByComma = function(str) {
                        strResult = [ ];
                        if (!str.match(regExpValidate))
                            return str;
                        while (str.match(regExpMain)) {
                            strResult.push(RegExp.$1);
                            str = str.replace(regExpMain, _strEmpty);
                        }

                        return strResult;
                    };
                    for (; i < properties[LEXICON.l]; i++) {
                        valueArray = splitCssStyleByComma(element.css(transitionStr + '-' + properties[i]));
                        for (j = 0; j < valueArray[LEXICON.l]; j++)
                            result[j] = (result[j] ? result[j] + _strSpace : _strEmpty) + valueArray[j];
                    }
                    return result.join(', ');
                }
1323546
function process(src, filename) {
  // strip out <style> tags to prevent failure when unable to parse PostCSS etc.
  const re = /<style[^>]*>([\S\s]*?)<\/style>/g;
  const normalised = src.replace(re, '');

  const result = svelte.compile(normalised, {
    filename,
    css: false,
    format: 'cjs',
  });

  return {
    code: result.js.code,
    map: result.js.map,
  };
}
345450
function handleComplete() {
        const isComplete = cssArray.indexOf(null) === -1;

        if (isComplete) {
            const cssText = cssArray.join('');

            settings.onComplete(cssText, cssArray, sourceNodes);
        }
    }
297537
function stylelint() {
  return gulp.src([
      './src/**/*.css',
      '!./src/components/combination.css', // not following BEM
      '!./src/iphonex-support/**/*.css' // not following BEM
    ], cwdOption)
    .pipe(stylelintPlugin({
      failAfterError: false,
      reporters: [{formatter: 'string', console: true}],
      configFile: path.join(__dirname, 'stylelint.config.js') // uses css-components/stylelint.config.js even when run from main gulpfile
    }));
}
1029765
function insertCss(styles, { replace = false, prepend = false, prefix = 's' } = {}) {
  const ids = []
  for (let i = 0; i < styles.length; i++) {
    const [moduleId, css, media, sourceMap] = styles[i]
    const id = `${prefix}${moduleId}-${i}`

    ids.push(id)

    if (inserted[id]) {
      if (!replace) {
        inserted[id]++
        continue
      }
    }

    inserted[id] = 1

    let elem = document.getElementById(id)
    let create = false

    if (!elem) {
      create = true

      elem = document.createElement('style')
      elem.setAttribute('type', 'text/css')
      elem.id = id

      if (media) {
        elem.setAttribute('media', media)
      }
    }

    let cssText = css
    if (sourceMap && typeof btoa === 'function') {
      // skip IE9 and below, see http://caniuse.com/atob-btoa
      cssText += `\n/*# sourceMappingURL=data:application/json;base64,${b64EncodeUnicode(
        JSON.stringify(sourceMap),
      )}*/`
      cssText += `\n/*# sourceURL=${sourceMap.file}?${id}*/`
    }

    if ('textContent' in elem) {
      elem.textContent = cssText
    } else {
      elem.styleSheet.cssText = cssText
    }

    if (create) {
      if (prepend) {
        document.head.insertBefore(elem, document.head.childNodes[0])
      } else {
        document.head.appendChild(elem)
      }
    }
  }

  return removeCss.bind(null, ids)
}
529231
function parseCssForImports(link, css) {
    link.imports = resolveCssImportUrls(link.url, css)
    status.total += link.imports.length
    result.css += css

    link.imports.forEach(function(importUrl) {
      var importLink = createLink(importUrl, importUrl)
      result.links.push(importLink)

      getLinkContents(importLink.url, options)
        .then(function(css) {
          handleCssFromLink(importLink, css)
        })
        .catch(function(error) {
          link.error = error
          status.parsed++
          handleResolve()
        })
    })
  }
708001
function cssProxy(
    element,
    props,
    pseudo
){
    if ( element === void 0 ) element = document.documentElement;
    if ( props === void 0 ) props = {};

    if(typeof props !== 'object'){
        props = {};
    }

    var allstyles = getComputedStyle(element, pseudo);

    function getName(name){
        //Computed styles contain all the properties.
        if(allstyles[name] === void 0){
            //supporting camelcase properties
            return '--'+decamelize(name, '-');
        }
        return decamelize(name, '-');
    }

    var css = Object.assign(Object.create(null), ( obj = {
        setProperty: function setProperty(name, value, priority){
            element.style.setProperty(name, value, priority);
        },
        getProperty: function getProperty(name){
            return allstyles.getPropertyValue(name);
        },
        cssGet: function cssGet(name){
            if(nameOnElement(element, name)){
                return element.style[name];
            }
            var v = this.getProperty(getName(name));
            return !v || !v.length ? undefined : v.trim();
        },
        cssSet: function cssSet(name, value, priority){
            this.setProperty(getName(name), convertValue(value), priority);
        },
        remove: function remove(name){
            element.style.removeProperty(name);
        },
        setAll: function setAll(){
            var this$1 = this;
            var propObjects = [], len = arguments.length;
            while ( len-- ) propObjects[ len ] = arguments[ len ];

            propObjects.forEach(function (props){
                Object.keys(props).forEach(function (key){
                    this$1.cssSet(key, props[key]);
                });
            });
            return this;
        }
    }, obj[Symbol.toPrimitive] = function (hint){
            return '[object CSSProxy]';
        }, obj ));
    var obj;

    var proxy = new Proxy(css, {
        get: function get(target, name){
            //Return methods
            if(typeof target[name] === 'function')
                { return target[name].bind(target); }
            //Return properties
            return target.cssGet(name);
        },
        set: function set(target, name, value){
            target.cssSet(name, value);
            return true;
        }
    });

    Object.keys(props).forEach(function (key){
        proxy[key] = props[key];
    });

    return proxy;
}