How to use the css-selector-tokenizer.stringifyValues function in css-selector-tokenizer

To help you get started, we’ve selected a few css-selector-tokenizer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elastic / timelion / node_modules / css-loader / lib / processCss.js View on Github external
case "url":
						if(!/^#/.test(item.url) && loaderUtils.isUrlRequest(item.url, options.root)) {
							item.stringType = "";
							delete item.innerSpacingBefore;
							delete item.innerSpacingAfter;
							var url = item.url;
							item.url = "___CSS_LOADER_URL___" + urlItems.length + "___";
							urlItems.push({
								url: url
							});
						}
						break;
					}
				});
			});
			decl.value = Tokenizer.stringifyValues(values);
		});
		css.eachAtRule(function(atrule) {
github fossasia / susper.com / node_modules / css-loader / lib / processCss.js View on Github external
css.walkAtRules(/^import$/i, function(rule) {
				var values = Tokenizer.parseValues(rule.params);
				var url = values.nodes[0].nodes[0];
				if(url && url.type === "url") {
					url = url.url;
				} else if(url && url.type === "string") {
					url = url.value;
				} else throw rule.error("Unexpected format " + rule.params);
				if (!url.replace(/\s/g, '').length) {
					return;
				}
				values.nodes[0].nodes.shift();
				var mediaQuery = Tokenizer.stringifyValues(values);
				if(loaderUtils.isUrlRequest(url, options.root) && options.mode === "global") {
					url = loaderUtils.urlToRequest(url, options.root);
				}
				importItems.push({
					url: url,
					mediaQuery: mediaQuery
				});
				rule.remove();
			});
		}
github cedricdelpoux / react-google-map / node_modules / css-loader / lib / processCss.js View on Github external
css.walkAtRules("import", function(rule) {
				var values = Tokenizer.parseValues(rule.params);
				var url = values.nodes[0].nodes[0];
				if(url.type === "url") {
					url = url.url;
				} else if(url.type === "string") {
					url = url.value;
				} else throw rule.error("Unexpected format" + rule.params);
				values.nodes[0].nodes.shift();
				var mediaQuery = Tokenizer.stringifyValues(values);
				if(loaderUtils.isUrlRequest(url, options.root) && options.mode === "global") {
					url = loaderUtils.urlToRequest(url, options.root);
				}
				importItems.push({
					url: url,
					mediaQuery: mediaQuery
				});
				rule.remove();
			});
		}
github sx1989827 / DOClever / Client / node_modules / postcss-modules-local-by-default / index.js View on Github external
function localizeDeclValues(localize, valuesNode, decl, context) {
  var newValuesNode = Object.create(valuesNode);
  newValuesNode.nodes = valuesNode.nodes.map(function(valueNode) {
    var subContext = {
      options: context.options,
      global: context.global,
      localizeNextItem: localize && !context.global
    };
    return localizeDeclValue(valueNode, subContext);
  });
  decl.value = Tokenizer.stringifyValues(newValuesNode);
}
github sx1989827 / DOClever / node_modules / css-loader / lib / processCss.js View on Github external
css.walkDecls(function(decl) {
			var values = Tokenizer.parseValues(decl.value);
			values.nodes.forEach(function(value) {
				value.nodes.forEach(processNode);
			});
			decl.value = Tokenizer.stringifyValues(values);
		});
		css.walkAtRules(function(atrule) {
github wix / stylable / packages / stylable / src / stylable-assets.ts View on Github external
export function processDeclarationUrls(
    decl: postcss.Declaration,
    onUrl: OnUrlCallback,
    transform: boolean
) {
    const ast = parseValues(decl.value);
    ast.nodes.forEach((node: ParsedValue) => {
        node.nodes!.forEach((node: ParsedValue) => findUrls(node, onUrl));
    });
    if (transform) {
        decl.value = stringifyValues(ast);
    }
}
github fossasia / susper.com / node_modules / css-loader / lib / processCss.js View on Github external
css.walkDecls(function(decl) {
			var values = Tokenizer.parseValues(decl.value);
			values.nodes.forEach(function(value) {
				value.nodes.forEach(processNode);
			});
			decl.value = Tokenizer.stringifyValues(values);
		});
		css.walkAtRules(function(atrule) {
github willurmston / Tone.Editor / node_modules / css-loader / lib / processCss.js View on Github external
css.walkDecls(function(decl) {
			var values = Tokenizer.parseValues(decl.value);
			values.nodes.forEach(function(value) {
				value.nodes.forEach(processNode);
			});
			decl.value = Tokenizer.stringifyValues(values);
		});
		css.walkAtRules(function(atrule) {
github sx1989827 / DOClever / Client / node_modules / css-loader / lib / processCss.js View on Github external
css.walkAtRules(/^import$/i, function(rule) {
				var values = Tokenizer.parseValues(rule.params);
				var url = values.nodes[0].nodes[0];
				if(url && url.type === "url") {
					url = url.url;
				} else if(url && url.type === "string") {
					url = url.value;
				} else throw rule.error("Unexpected format " + rule.params);
				if (!url.replace(/\s/g, '').length) {
					return;
				}
				values.nodes[0].nodes.shift();
				var mediaQuery = Tokenizer.stringifyValues(values);
				if(loaderUtils.isUrlRequest(url, options.root) && options.mode === "global") {
					url = loaderUtils.urlToRequest(url, options.root);
				}
				importItems.push({
					url: url,
					mediaQuery: mediaQuery
				});
				rule.remove();
			});
		}
github sx1989827 / DOClever / node_modules / css-loader / lib / processCss.js View on Github external
css.walkAtRules(/^import$/i, function(rule) {
				var values = Tokenizer.parseValues(rule.params);
				var url = values.nodes[0].nodes[0];
				if(url && url.type === "url") {
					url = url.url;
				} else if(url && url.type === "string") {
					url = url.value;
				} else throw rule.error("Unexpected format " + rule.params);
				if (!url.replace(/\s/g, '').length) {
					return;
				}
				values.nodes[0].nodes.shift();
				var mediaQuery = Tokenizer.stringifyValues(values);

				if(loaderUtils.isUrlRequest(url, options.root)) {
					url = loaderUtils.urlToRequest(url, options.root);
				}

				importItems.push({
					url: url,
					mediaQuery: mediaQuery
				});
				rule.remove();
			});
		}

css-selector-tokenizer

Parses and stringifies CSS selectors

MIT
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis