Skip to content

Commit 48c077c

Browse files
authored
chore: scope theming variables used in illustrations (#12687)
1 parent e8baacc commit 48c077c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/tools/lib/create-illustrations/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
const fs = require("fs").promises;
22
const path = require("path");
3+
const { scopeThemingVariables } = require("../css-processors/scope-variables.mjs");
34

45
const generate = async (argv) => {
56
if (argv.length < 7) {
@@ -91,7 +92,7 @@ const generate = async (argv) => {
9192
console.log(`Generating illustrations from ${srcPath} to ${destPath}`)
9293

9394
const svgImportTemplate = svgContent => {
94-
return `export default \`${svgContent}\`;`
95+
return `export default \`${scopeThemingVariables(svgContent)}\`;`
9596
};
9697
const svgToJs = async fileName => {
9798
const svg = await fs.readFile(path.join(srcPath, fileName), { encoding: "utf-8" });

packages/tools/lib/css-processors/scope-variables.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ const scopeUi5Variables = (cssText, packageJSON, inputFile) => {
4545
return newText.replaceAll("--sap", `--ui5-sap`);
4646
}
4747

48+
// Used with CSS text and SVG file content (illustrations)
4849
const scopeThemingVariables = (cssText) => {
4950
return cssText.replaceAll("--sap", `--ui5-sap`);
5051
}

0 commit comments

Comments
 (0)