From bf4e16b2c8b4b47a89efab038adcee9c92361564 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 31 Oct 2024 10:15:40 -0700 Subject: [PATCH 1/2] fix explainer tool --- tools/sass-variable-explainer/parse-web.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/sass-variable-explainer/parse-web.ts b/tools/sass-variable-explainer/parse-web.ts index b35c26979f..f187b86f40 100644 --- a/tools/sass-variable-explainer/parse-web.ts +++ b/tools/sass-variable-explainer/parse-web.ts @@ -4,4 +4,4 @@ import { parse } from 'https://cdn.skypack.dev/scss-parser/'; // import * as prettier from "https://esm.sh/prettier@3.3.3"; // skypack crashes with prettier import { makeParserModule } from "./parse.ts"; -export const getSassAst = makeParserModule(parse, (s: string) => s).getSassAst; \ No newline at end of file +export const getSassAst = makeParserModule(parse).getSassAst; \ No newline at end of file From 6ff9fe57dc344298e622b2bc63ef0a2a028de841 Mon Sep 17 00:00:00 2001 From: Carlos Scheidegger Date: Thu, 31 Oct 2024 10:15:54 -0700 Subject: [PATCH 2/2] forward background color from monospace to -block and -inline --- src/core/sass/brand.ts | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/core/sass/brand.ts b/src/core/sass/brand.ts index 9004b0653a..e2150d23f9 100644 --- a/src/core/sass/brand.ts +++ b/src/core/sass/brand.ts @@ -198,7 +198,7 @@ const brandColorBundle = ( ); colorCssVariables.push( ` --brand-${colorVar}: ${brand.getColor(colorKey)};`, - ) + ); } // Map theme colors directly to Sass variables @@ -222,7 +222,10 @@ const brandColorBundle = ( } // const colorEntries = Object.keys(brand.color); colorVariables.push('// quarto-scss-analysis-annotation { "action": "pop" }'); - colorCssVariables.push("}", '// quarto-scss-analysis-annotation { "action": "pop" }'); + colorCssVariables.push( + "}", + '// quarto-scss-analysis-annotation { "action": "pop" }', + ); const colorBundle: SassBundleLayers = { key, // dependency: "bootstrap", @@ -239,13 +242,13 @@ const brandColorBundle = ( const brandBootstrapBundle = ( brand: Brand, - key: string + key: string, ): SassBundleLayers => { // Bootstrap Variables from brand.defaults.bootstrap - const brandBootstrap = (brand?.data?.defaults?.bootstrap as unknown as Record< + const brandBootstrap = brand?.data?.defaults?.bootstrap as unknown as Record< string, Record - >); + >; const bsVariables: string[] = [ "/* Bootstrap variables from _brand.yml */", @@ -276,7 +279,7 @@ const brandBootstrapBundle = ( "green", "teal", "cyan", - ] + ]; const bsColors: string[] = [ "/* Bootstrap color variables from _brand.yml */", @@ -459,6 +462,10 @@ const brandTypographyBundle = ( // revealjs ["size", "code-block-font-size"], ["color", "code-block-color"], + + // monospace forwards to both block and inline + ["background-color", "code-bg"], + ["background-color", "code-block-bg"], ], "monospace-block": [ // bootstrap + revealjs @@ -566,7 +573,12 @@ export async function brandBootstrapSassBundleLayers( nameMap: Record = {}, ): Promise { const brand = await project.resolveBrand(fileName); - const sassBundles = await brandSassBundleLayers(fileName, project, key, nameMap); + const sassBundles = await brandSassBundleLayers( + fileName, + project, + key, + nameMap, + ); if (brand?.data?.defaults?.bootstrap) { const bsBundle = brandBootstrapBundle(brand, key);