Returns the index just past the `url(...)` token that begins at `i`.
(css, i)
| 352 | |
| 353 | /** Returns the index just past the `url(...)` token that begins at `i`. */ |
| 354 | function 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 | |
| 375 | export function prepareTailwindPluginCss(css) { |
| 376 | const root = postcss.parse(css, { from: undefined }); |
no test coverage detected