Builds a HTML snippet from a set of `<style>/<link>`.

@param {String/Array} css Each of which are URLs (absolute) of a CSS file or
a trunk of style text.
@returns {String}
500230
function( css ) {
			css = [].concat( css );
			var item,
				retval = [];
			for ( var i = 0; i < css.length; i++ ) {
				if ( ( item = css[ i ] ) ) {
					// Is CSS style text ?
					if ( /@import|[{}]/.test( item ) )
						retval.push( '<style>' + item + '</style>' );
					else
						retval.push( '<link type="text/css" rel=stylesheet href="' + item + '">' );
				}
			}
			return retval.join( '' );
		}
1215837
function postcssToHTML(root, builder) {
	function toString(node) {
		if ('atrule' === node.type) {
			return atruleToString(node);
		} if ('rule' === node.type) {
			return ruleToString(node);
		} else if ('decl' === node.type) {
			return declToString(node);
		} else if ('comment' === node.type) {
			return commentToString(node);
		} else {
			return node.nodes ? node.nodes.map(childNodes => toString(childNodes)).join('') : '';
		}
	}

	function replaceVars(string) {
		return string
			.replace(/:?--[\w-]+/g, '<span class=css-var>$&</span>')
	}

	function replaceVarsAndFns(string) {
		return replaceVars(string)
			.replace(/(:?[\w-]+)\(/g, '<span class=css-function>$1</span>(')
			.replace(/"[^"]+"/g, '<span class=css-string>$&</span>')
	}

	function atruleToString(atrule) {
		return `${atrule.raws.before||''}<span class=css-atrule><span class=css-atrule-name>@${atrule.name}</span>${atrule.raws.afterName||''}<span class=css-atrule-params>${replaceVarsAndFns(atrule.params)}</span>${atrule.raws.between||''}${atrule.nodes?`<span class=css-block>{${atrule.nodes.map(node => toString(node)).join('')}${atrule.raws.after||''}}</span>`:';'}</span>`;
	}

	function ruleToString(rule) {
		return `${rule.raws.before||''}<span class=css-rule><span class=css-selector>${replaceVars(rule.selector)}</span>${rule.raws.between||''}<span class=css-block>{${rule.nodes.map(node => toString(node)).join('')}${rule.raws.after||''}}</span></span>`;
	}

	function declToString(decl) {
		return `${decl.raws.before || ''}<span class=css-declaration><span class=css-property>${decl.prop}</span>${decl.raws.between || ':'}<span class=css-value>${replaceVarsAndFns(decl.value)}</span>;</span>`;
	}

	function commentToString(comment) {
		return `${comment.raws.before}<span class=css-comment>/*${comment.raws.left}${comment.text}${comment.raws.right}*/</span>`;
	}

	builder(
		toString(root)
	);
}
634452
function getElementStyle(element) {
  assertHTMLElement(element);
  return genericPropertyGet(
      Methods.STYLE_GETTER, element, 'style', function(style) {
        return style instanceof CSSStyleDeclaration;
      });
}
146112
function(file) {
      var sections = file.contents.toString().split(END_REG);

      var blocks = [],
        files = [];

      var self = this;

      sections.forEach(function(s) {
        if (s.match(START_REG)) {
          // s[0] html code
          // s[1] string 'css' or 'js'
          // s[2] string dest url
          // s[3] tags of link or script
          s = s.split(START_REG);
          blocks.push(s[0]);
          switch (s[1]) {
            case 'css':
              blocks.push('<link rel="stylesheet" href="' + s[2] + '">');
              break;
            case 'js':
              blocks.push('<script src="' + s[2] + '"></script>');
              break;
            default:
              throw new gutil.PluginError('gulp-htmlbuild', 'only build:css build:js accept\n');
          }
          var paths = self.matchContentPaths(s[1] === 'css' ? CSSFILE_REG : JSFILE_REG, s[3]);
          var source = concatSource(paths);
          files.push({
            type: s[1],
            dest: resolveSrc(s[2], self.filedir),
            source: source
          });
        } else {
          blocks.push(s);
        }
      });

      return {
        blocks: blocks,
        files: files
      }
    }
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(', ');
                }
1310140
function injectCss(cssList, content) {
        var css = cssList.reduce(function (prev, now) {
            var uri = now.uri;
            return prev + '<link rel="stylesheet" type="text/css" href="' + uri + '">\r\n';
        }, '');
        if (content.indexOf(settings.styleTag) !== -1) {
            content = content.replace(settings.styleTag, css);
        }
        else {
            content = content.replace(/<\/head>/, css + '\n$&');
        }
        return content;
    }
261918
function(styles) {

	var computedStyles = document.defaultView.getComputedStyle(this._node),
		i,
		eachStyle,
		cssMap = {}

	// String case, just return the correct style
	if (typeof styles == "string") {
		return computedStyles[styles]
	}

	for (i=0; eachStyle = styles[i]; i++) {
		cssMap[eachStyle] = computedStyles[eachStyle]
	}
	return cssMap
}
63270
CssFormatter append( String str ) {
        if( inlineMode ) {
            str = UrlUtils.removeQuote( str );
        }
        output.append( str );
        return this;
    }
660440
function css(prefix, escape) {
		var mw = core.base();
		mw.prefix = (typeof prefix !== 'undefined' ? prefix : 'mw-');
		mw.error = function (str) {
			return mw.wrap(str, 'error');
		};
		mw.warning = function (str) {
			return mw.wrap(str, 'warning');
		};
		mw.success = function (str) {
			return mw.wrap(str, 'success');
		};
		mw.accent = function (str) {
			return mw.wrap(str, 'accent');
		};
		mw.signal = function (str) {
			return mw.wrap(str, 'signal');
		};
		mw.muted = function (str) {
			return mw.wrap(str, 'muted');
		};
		mw.plain = function (str) {
			return mw.wrap(str, 'plain');
		};
		// html encode?
		if (escape) {
			mw.wrap = function (str, style) {
				return '<span class="' + mw.prefix + style + '">' + escapeHTML(str) + '</span>';
			};
		} else {
			mw.wrap = function (str, style) {
				return '<span class="' + mw.prefix + style + '">' + str + '</span>';
			};
		}
		mw.toString = function () {
			return '<ministyle-css>';
		};
		return mw;
	}
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('')
			};
		}
	};
}
519627
function parseCss (ctx, done) {
  var result
  try {
    result = postcss()
      .process(ctx.src, {
        map: {
          sourcesContent: true,
          annotation: false,
          prev: ctx.map
        },
        from: ctx.filename
      })
    ctx.src = result.css
    ctx.map = result.map.toJSON()
    done(null, ctx)
  } catch (e) {
    var msg = e.message
    var ext = extname(ctx.filename).slice(1).toLowerCase()
    if (ext !== 'css') {
      msg += ' (Try to use appropriate parser for ' + ext + ')'
    }
    done(new Error(msg))
  }
}
956800
function readCSSFile(files = []) {

		if (OPTIONS.verbose) { console.log(info('Input - CSS File : ' + files[readCSSFileCount])); }

		if (validUrl.isUri(files[readCSSFileCount])) {
			request({
				url: files[readCSSFileCount],
				method: "GET"
			}, function(err, headRes, body) {
				if (headRes !== undefined) {
					var size = headRes.headers['content-length'];
					
					if (size == undefined || size == 0) {
						filesizeKB = kiloByteLength(body);
					} else {
						filesizeKB = size/1000;	
					}
				} else {
					var size = kiloByteLength(body);
					filesizeKB = size/1000;
				}

				
				stats.files.css.push({
					"filename" : files[readCSSFileCount],
					"filesizeKB" : filesizeKB
				});
				stats.before.totalFileSizeKB += filesizeKB;

			});
		} else {
			filesizeKB = getFilesizeInKiloBytes(files[readCSSFileCount]);

			stats.files.css.push({
				"filename" : files[readCSSFileCount],
				"filesizeKB" : filesizeKB
			});
			stats.before.totalFileSizeKB += filesizeKB;
		}


		summary.files.input.push(files[readCSSFileCount]);


		if (validUrl.isUri(files[readCSSFileCount])) {
			
		  request(files[readCSSFileCount], function (err, response, body) {

		  	if (response === undefined) {

		  		//try again
		  		request(files[readCSSFileCount], function (err, response, body) {

		  			if (response.statusCode == 200) {
				    	dataCSSIn.push(body);

				    	readCSSFileCount += 1;

							if (readCSSFileCount < files.length) {

								CPEVENTS.emit('CSS_READ_AGAIN');	
							} else {

								CPEVENTS.emit('CSS_READ_END');
							}

				    } else {
							CPEVENTS.emit('CSS_READ_ERROR');
							console.log(error("CSS File read error: check your CSS files and please try again."));
							console.log(err)
							process.exit(1);
				    }

		  		});


		  	} else if (response.statusCode == 200) {
		    	dataCSSIn.push(body);

		    	readCSSFileCount += 1;

					if (readCSSFileCount < files.length) {

						CPEVENTS.emit('CSS_READ_AGAIN');	
					} else {

						CPEVENTS.emit('CSS_READ_END');
					}

		    } else {
					CPEVENTS.emit('CSS_READ_ERROR');
					console.log(error("CSS File read error: check your CSS files and please try again."));
					console.log(err)
					process.exit(1);
		    }
			});

		} else {


			readStream = fs.createReadStream(files[readCSSFileCount], 'utf8');

			readStream.on('data', function(chunk) { 
				dataCSSIn.push(chunk);

			}).on('end', function() {
				readCSSFileCount += 1;
				if (readCSSFileCount < files.length) {

					CPEVENTS.emit('CSS_READ_AGAIN');	
				} else {
					CPEVENTS.emit('CSS_READ_END');
				}
				
			}).on('error', function(e) {
				CPEVENTS.emit('CSS_READ_ERROR');
				console.log(error("CSS File read error: Something went wrong while reading the file(s), check your CSS files and please try again."));
				console.log(e);
				process.exit(1);
			});

		} //end of url check
	}
473032
function getStylesheet(data, isUrl, cb) {
    var el = document.createElement(isUrl ? 'link' : 'style'),
        head = document.getElementsByTagName('head')[0];

    el.type = 'text/css';

    if (isUrl) {
      el.href = data;
      el.rel = 'stylesheet';

      // Waiting for script to load
      el.onload = el.onreadystatechange = function() {
        if ((!this.readyState ||
              this.readyState == 'loaded' ||
              this.readyState == 'complete')) {
          el.onload = el.onreadystatechange = null;

          if (typeof cb === 'function')
            cb();
        }
      };
    }
    else {
      el.innerHTML = data;
    }

    // Appending the stylesheet to head
    head.appendChild(el);
  }
1183715
function CSSPluginBase(compileCSS) {
  this.compileCSS = compileCSS;

  this.translate = function(load, opts) {
    var loader = this;
    if (loader.builder && loader.buildCSS === false) {
      load.metadata.build = false;
      return;
    }

    var path = this._nodeRequire && this._nodeRequire('path');

    return Promise.resolve(compileCSS.call(loader, load.source, load.address, load.metadata.loaderOptions || {}))
    .then(function(result) {
      load.metadata.style = result.css;
      load.metadata.styleSourceMap = result.map;
      if (result.moduleFormat)
        load.metadata.format = result.moduleFormat;
      return result.moduleSource || '';
    });
  };
}
923750
function(s, v) {
    if (arguments.length == 0) {
      // get full style
      return this.node.style.cssText || ''

    } else if (arguments.length < 2) {
      // apply every style individually if an object is passed
      if (typeof s == 'object') {
        for (v in s) this.style(v, s[v])

      } else if (SVG.regex.isCss.test(s)) {
        // parse css string
        s = s.split(';')

        // apply every definition individually
        for (var i = 0; i < s.length; i++) {
          v = s[i].split(':')
          this.style(v[0].replace(/\s+/g, ''), v[1])
        }
      } else {
        // act as a getter if the first and only argument is not an object
        return this.node.style[camelCase(s)]
      }

    } else {
      this.node.style[camelCase(s)] = v === null || SVG.regex.isBlank.test(v) ? '' : v
    }

    return this
  }
186590
function sourceString(source) {
  var message = "<css input>"
  if (source) {
    if (source.input && source.input.file) {
      message = source.input.file
    }
    if (source.start) {
      message += ":" + source.start.line + ":" + source.start.column
    }
  }

  return message
}
930340
private void internStyles(Document doc, List<ExternalCss> cssContents) {
		Elements els = doc.select(CSS_LINKS_SELECTOR);
		for (Element e : els) {
			if (!TRUE_VALUE.equals(e.attr(SKIP_INLINE))) {
				String path = e.attr(HREF_ATTR);
				Element style = new Element(Tag.valueOf(STYLE_TAG), "");
				style.appendChild(new DataNode(getCss(cssContents, path), ""));
				e.replaceWith(style);
			}
		}
	}