You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"This is likely a Quarto bug.\nPlease consider reporting it at https://github.com/quarto-dev/quarto-cli,\nalong with the _quarto_internal_scss_error.scss file that can be found in the current working directory.",
169
-
);
170
-
}
171
-
172
155
if(!Deno.env.get("QUARTO_SAVE_SCSS")){
173
156
returnresult;
174
157
}
@@ -353,13 +336,44 @@ export function sassLayerDir(
353
336
};
354
337
}
355
338
339
+
typeCompileWithCacheOptions={
340
+
compressed?: boolean;
341
+
cacheIdentifier?: string;
342
+
addVarsBlock?: boolean;
343
+
};
344
+
356
345
exportasyncfunctioncompileWithCache(
357
346
input: string,
358
347
loadPaths: string[],
359
348
temp: TempContext,
360
-
compressed?: boolean,
361
-
cacheIdentifier?: string,
349
+
options?: CompileWithCacheOptions,
362
350
){
351
+
const{
352
+
compressed,
353
+
cacheIdentifier,
354
+
addVarsBlock,
355
+
}=options||{};
356
+
357
+
consthandleVarsBlock=(input: string)=>{
358
+
if(!addVarsBlock){
359
+
returninput;
360
+
}
361
+
try{
362
+
input+="\n"+cssVarsBlock(input);
363
+
}catch(e){
364
+
console.warn("Error adding css vars block",e);
365
+
console.warn(
366
+
"The resulting CSS file will not have SCSS color variables exported as CSS.",
"This is likely a Quarto bug.\nPlease consider reporting it at https://github.com/quarto-dev/quarto-cli,\nalong with the _quarto_internal_scss_error.scss file that can be found in the current working directory.",
371
+
);
372
+
throwe;
373
+
}
374
+
returninput;
375
+
};
376
+
363
377
if(cacheIdentifier){
364
378
// If there are imports, the computed input Hash is incorrect
365
379
// so we should be using a session cache which will cache
@@ -372,8 +386,16 @@ export async function compileWithCache(
372
386
: quartoCacheDir("sass");
373
387
// when using quarto session cache, we ensure to cleanup the cache files at TempContext cleanup
0 commit comments