@@ -222,6 +222,8 @@ function rewriteRelativeUrls(cssText, baseHref) {
222222// Supports both @import url("...") and @import "..."
223223const IMPORT_ANY_RE = / @ i m p o r t \s + (?: u r l \( \s * ( [ ' " ] ? ) ( [ ^ ) " ' ] + ) \1\s * \) | ( [ ' " ] ) ( [ ^ " ' ] + ) \3) ( [ ^ ; ] * ) ; / g
224224
225+ const MAX_IMPORT_DEPTH = 4
226+
225227/**
226228 * Flattens @import recursively and rewrites relative urls at each level
227229 * using that sheet's base href. Uses snapFetch (with proxy) on purpose
@@ -234,7 +236,6 @@ async function inlineImportsAndRewrite(cssText, ownerHref, useProxy) {
234236 if ( ! cssText ) return cssText
235237
236238 const visited = new Set ( )
237- const MAX_IMPORT_DEPTH = 10
238239
239240 function normalizeUrl ( u , base ) {
240241 try { return new URL ( u , base || location . href ) . href } catch { return u }
@@ -258,7 +259,7 @@ async function inlineImportsAndRewrite(cssText, ownerHref, useProxy) {
258259
259260 if ( visited . has ( absUrl ) ) {
260261 console . warn ( `[snapDOM] Skipping circular @import: ${ absUrl } ` )
261- continue // skip re-including this import
262+ continue
262263 }
263264 visited . add ( absUrl )
264265
@@ -504,7 +505,6 @@ async function collectFacesFromSheet(sheet, baseHref, emitFace, ctx) {
504505 const normalizeUrl = ( u , base ) => {
505506 try { return new URL ( u , base || location . href ) . href } catch { return u }
506507 }
507- const MAX_IMPORT_DEPTH = 10
508508
509509 for ( const rule of rules ) {
510510 if ( rule . type === CSSRule . IMPORT_RULE && rule . styleSheet ) {
@@ -961,7 +961,6 @@ export async function ensureFontsReady(families, warmupRepetitions = 2) {
961961
962962 document . body . appendChild ( container )
963963 // Force layout
964-
965964 container . offsetWidth
966965 document . body . removeChild ( container )
967966 }
0 commit comments