src/css.js
function createScopedCss(html, scope, filepath, cssVariables) {
	scope = typeof scope === 'string' ? {ns: scope, vars: new Map()} : scope;

	const style = html.match(styleMatcher);
	if (!style) {
		return [{}, scope.vars, ''];
	}
	const cssom = css.parse(style[1], {source: filepath});
	const vars = new Map(scope.vars.entries());
	getVariables(cssom).forEach((value, key) => vars.set(key, value));

	if (cssVariables) {
		resolveScopeVariables(cssom, vars);
	}
	const [classes, transformMap] = rewriteSelectors(`${decamelize(scope.ns, '-')}`, cssom);

	return [classes, vars, css.stringify(cssom), transformMap];
}
function createScopedCss(html, scope, filepath, cssVariables) {
	scope = typeof scope === 'string' ? {ns: scope, vars: new Map()} : scope;

	const style = html.match(styleMatcher);
	if (!style) {
		return [{}, scope.vars, ''];
	}
	const cssom = css.parse(style[1], {source: filepath});
	const vars = new Map(scope.vars.entries());
	getVariables(cssom).forEach((value, key) => vars.set(key, value));

	if (cssVariables) {
		resolveScopeVariables(cssom, vars);
	}
	const [classes, transformMap] = rewriteSelectors(`${decamelize(scope.ns, '-')}`, cssom);

	return [classes, vars, css.stringify(cssom), transformMap];
}
Strips scoped style from html and return html and metadata.

@param {string} html HTML input source
@param {Object|string} scope Namespace for generated classNames
@param {string?} filepath Input file path (mainly for debugging)
@param {boolean} cssVariables True if css-variables support should be enabled
@returns [classNames: any, vars: any, css: string, transformMap: Object]