MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / skipCssUrl

Function skipCssUrl

dashboard/build.shared.mjs:354–373  ·  view source on GitHub ↗

Returns the index just past the `url(...)` token that begins at `i`.

(css, i)

Source from the content-addressed store, hash-verified

352
353/** Returns the index just past the `url(...)` token that begins at `i`. */
354function skipCssUrl(css, i) {
355 let j = i + 3;
356 while (j < css.length && /\s/.test(css[j])) j++;
357 if (css[j] !== "(") return i + 1;
358 j++;
359 while (j < css.length && /\s/.test(css[j])) j++;
360 if (css[j] === '"' || css[j] === "'") {
361 j = skipCssString(css, j);
362 } else {
363 while (j < css.length && css[j] !== ")") {
364 if (css[j] === "\\") {
365 j += 2;
366 continue;
367 }
368 j++;
369 }
370 }
371 while (j < css.length && css[j] !== ")") j++;
372 return j < css.length ? j + 1 : j;
373}
374
375export function prepareTailwindPluginCss(css) {
376 const root = postcss.parse(css, { from: undefined });

Callers 1

minifyCssFunction · 0.85

Calls 2

skipCssStringFunction · 0.85
testMethod · 0.80

Tested by

no test coverage detected