Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

fix(viewer): honor fixed SVG export themes

杨嘉伟4b19ded731bd
diff --git a/archify.zip b/archify.zip
index 0011dc4f..3fe1f8cf 100644
Binary files a/archify.zip and b/archify.zip differ
diff --git a/archify/assets/template.html b/archify/assets/template.html
index d34bda40..f2106eb9 100644
--- a/archify/assets/template.html
+++ b/archify/assets/template.html
@@ -6343,9 +6343,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6365,17 +6368,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6387,9 +6390,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6404,7 +6407,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -6974,7 +6977,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/examples/dataflow-product-analytics.html b/archify/examples/dataflow-product-analytics.html
index 86f7d8ed..f9eccdd4 100644
--- a/archify/examples/dataflow-product-analytics.html
+++ b/archify/examples/dataflow-product-analytics.html
@@ -6454,9 +6454,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6476,17 +6479,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6498,9 +6501,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6515,7 +6518,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7085,7 +7088,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/examples/lifecycle-agent-run.html b/archify/examples/lifecycle-agent-run.html
index df09a2a8..cf45fa09 100644
--- a/archify/examples/lifecycle-agent-run.html
+++ b/archify/examples/lifecycle-agent-run.html
@@ -6389,9 +6389,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6411,17 +6414,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6433,9 +6436,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6450,7 +6453,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7020,7 +7023,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/examples/sequence-cache-miss-request.html b/archify/examples/sequence-cache-miss-request.html
index e67d6658..6b9116de 100644
--- a/archify/examples/sequence-cache-miss-request.html
+++ b/archify/examples/sequence-cache-miss-request.html
@@ -6469,9 +6469,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6491,17 +6494,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6513,9 +6516,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6530,7 +6533,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7100,7 +7103,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/examples/web-app-rendered.html b/archify/examples/web-app-rendered.html
index 42097c2f..f5efa89b 100644
--- a/archify/examples/web-app-rendered.html
+++ b/archify/examples/web-app-rendered.html
@@ -6442,9 +6442,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6464,17 +6467,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6486,9 +6489,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6503,7 +6506,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7073,7 +7076,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/examples/workflow-agent-tool-call-rendered.html b/archify/examples/workflow-agent-tool-call-rendered.html
index 4396f65b..626a809a 100644
--- a/archify/examples/workflow-agent-tool-call-rendered.html
+++ b/archify/examples/workflow-agent-tool-call-rendered.html
@@ -6460,9 +6460,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6482,17 +6485,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6504,9 +6507,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6521,7 +6524,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7091,7 +7094,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/archify/test/export-cleanup-browser.test.mjs b/archify/test/export-cleanup-browser.test.mjs
index fc7669a7..7ea51b76 100644
--- a/archify/test/export-cleanup-browser.test.mjs
+++ b/archify/test/export-cleanup-browser.test.mjs
@@ -114,8 +114,8 @@ test('Export cleanup preserves canonical artifacts and live interaction state',
await t.test('explicit light and dark SVG exports stay fixed under the opposite OS theme', async () => {
const cases = [
- { authorTheme: 'light', hostTheme: 'dark', format: 'svg-light', theme: 'light', background: 'rgb(248, 250, 252)' },
- { authorTheme: 'dark', hostTheme: 'light', format: 'svg-dark', theme: 'dark', background: 'rgb(2, 6, 23)' },
+ { authorTheme: 'dark', hostTheme: 'dark', format: 'svg-light', theme: 'light', background: 'rgb(248, 250, 252)' },
+ { authorTheme: 'light', hostTheme: 'light', format: 'svg-dark', theme: 'dark', background: 'rgb(2, 6, 23)' },
];
for (const item of cases) {
await load(files.architecture, item.authorTheme);
@@ -153,6 +153,20 @@ test('Export cleanup preserves canonical artifacts and live interaction state',
}
});
+ await t.test('fixed SVG options do not depend on WebP encoding', async () => {
+ const script = await send('Page.addScriptToEvaluateOnNewDocument', { source: `
+ HTMLCanvasElement.prototype.toDataURL = function () { return 'data:image/png;base64,'; };
+ ` });
+ try {
+ await load(files.architecture);
+ for (const format of ['svg', 'svg-light', 'svg-dark']) {
+ assert.equal(await evaluate(`document.querySelector('[data-format="${format}"]').disabled`), false, format);
+ }
+ } finally {
+ await send('Page.removeScriptToEvaluateOnNewDocument', { identifier: script.identifier });
+ }
+ });
+
await t.test('real zoom, focus, preview, lens, story and route actions leave exports clean', async () => {
await load(files.architecture);
const pristine = await exported('interaction-pristine');
diff --git a/docs/gallery.html b/docs/gallery.html
index 993c14f0..06c23a4f 100644
--- a/docs/gallery.html
+++ b/docs/gallery.html
@@ -298,7 +298,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 11E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="9449f18562cc45956597384867db12492f55eb46cd3e3436da9fcf6249d6f319">9449f18562cc</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="28c4eb28d352ecd6489e9c10eafc32323d2fd4100a474ebedc59bb809f0a2c19">28c4eb28d352</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-tool-call.workflow.html?present=1&amp;play=1#view=happy-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -328,7 +328,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="050420ae94535512340610575d118cd903914b496450825c6455799748eb28c4">050420ae9453</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="13e57abb96b02a04aa39135d3ce4bc3098ac7c73125a59f988603041e7df3fc0">13e57abb96b0</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/production-deployment.architecture.html?present=1&amp;play=1#view=request-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -357,7 +357,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="7151915ebea4646bbdabdc3d06677984481909304ff9cabae13b8a08a7a8674b">7151915ebea4</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="564d9b9365f2aaab77bedec77914d2b8c1155a3fdd69ceae2d3f60a763b2834b">564d9b9365f2</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/cache-miss.sequence.html?present=1&amp;play=1#view=cache-fallback" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -386,7 +386,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="c565cd212b0d7595e3b142b9959d4bfff3396a01cd470899a7be060e1a4aedcf">c565cd212b0d</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="908946adbc119a54a001b1c44dc7746636df301dfb8b8f87fe6f57f42f4c5939">908946adbc11</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/release-delivery.workflow.html?present=1&amp;play=1#view=approval-to-production" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -415,7 +415,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="15c799fb0eef1a1fca4774d69832eacc4fcb62f88bede9e6bc0508237a3eabbf">15c799fb0eef</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="5d90a65e268f123a1a19ec08318bb64e5352ed62211f6805b62b36ac4711502d">5d90a65e268f</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/incident-response.workflow.html?present=1&amp;play=1#view=mitigate-and-verify" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -444,7 +444,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 10E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="87dd2fc5a143a560d912eac2db8b445325dc2c664f6bb5b253500f97faf953c8">87dd2fc5a143</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="4fbc89f8f13c05900207ceeb7708c6b9129e8988916d71615d9bcb6d960798b9">4fbc89f8f13c</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/product-analytics.dataflow.html?present=1&amp;play=1#view=consent-boundary" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -473,7 +473,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">7N · 14E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="171fc59cee4b0b55d516da1957f99b2ecedac3e3b9b287358db42ae03faf333d">171fc59cee4b</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="93c219a959043bad4abf9901fec4429eb31b447ee051bbcb75ca808e47a8f1a1">93c219a95904</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/async-job-roundtrip.sequence.html?present=1&amp;play=1#view=work-and-retry" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -502,7 +502,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">12N · 12E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="d32717a725a089d98e4b08aa5f2ad89549e16b6dea53f8493d189fbe699e30f9">d32717a725a0</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="f6c6bedb86eec1791e0af20b33cfa88a9190b7ebb4d1460638a94838d5d8032d">f6c6bedb86ee</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/event-stream.dataflow.html?present=1&amp;play=1#view=order-transit" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -531,7 +531,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="b6887cd22e16be826cb25c4e1a367fda4c69297cc59cefe271f90b133a0a0a49">b6887cd22e16</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="061318b52f2f4a274a9938f6987aea6991eac0a9666f598c537fb049c43f7cc6">061318b52f2f</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/agent-run.lifecycle.html?present=1&amp;play=1#view=main-lifecycle" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -560,7 +560,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">11N · 6E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="2c6cfe2bdfebf4eda0eb97b77e60c48e70b0b30e4b9257d86096fc5beea14ab3">2c6cfe2bdfeb</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="cd731531477518cdbaaf01640025828a449e777512ff106ca8ddf4a504c5d563">cd7315314775</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/deployment-release.lifecycle.html?present=1&amp;play=1#view=rollback-outcomes" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -589,7 +589,7 @@
<div class="receipt-cell"><span class="receipt-label">Artifact</span><span class="receipt-value ok">9/9 pass</span></div>
<div class="receipt-cell"><span class="receipt-label">Composition</span><span class="receipt-value ok" title="0 crossings · 0 border runs · 0 micro segments · 0 cramped turns">SHOWCASE · PASS</span></div>
<div class="receipt-cell"><span class="receipt-label">Graph</span><span class="receipt-value">10N · 9E</span></div>
- <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="678699af5b7a6e573f25cefc8a83fa240b18e60978693a30b52a73473a5656ad">678699af5b7a</span></div>
+ <div class="receipt-cell"><span class="receipt-label">SHA-256</span><span class="receipt-value" title="06ecdebbb365cdc54ae81ee99d4ff7ce98aa6944f6be3d42f66ce0cd5c8748a9">06ecdebbb365</span></div>
</div>
<div class="card-actions">
<a class="card-link primary" href="gallery/artifacts/web-app.architecture.html?present=1&amp;play=1#view=request-path" target="_blank" rel="noopener" data-en="Play named chapter ↗" data-zh="播放命名章节 ↗">Play named chapter ↗</a>
@@ -675,8 +675,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 844423,
- "artifactSha256": "9449f18562cc45956597384867db12492f55eb46cd3e3436da9fcf6249d6f319",
+ "artifactBytes": 844656,
+ "artifactSha256": "28c4eb28d352ecd6489e9c10eafc32323d2fd4100a474ebedc59bb809f0a2c19",
"sourceBytes": 5687,
"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c",
"checks": [
@@ -796,8 +796,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 847651,
- "artifactSha256": "050420ae94535512340610575d118cd903914b496450825c6455799748eb28c4",
+ "artifactBytes": 847884,
+ "artifactSha256": "13e57abb96b02a04aa39135d3ce4bc3098ac7c73125a59f988603041e7df3fc0",
"sourceBytes": 5476,
"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
@@ -922,8 +922,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 839535,
- "artifactSha256": "7151915ebea4646bbdabdc3d06677984481909304ff9cabae13b8a08a7a8674b",
+ "artifactBytes": 839768,
+ "artifactSha256": "564d9b9365f2aaab77bedec77914d2b8c1155a3fdd69ceae2d3f60a763b2834b",
"sourceBytes": 4374,
"sourceSha256": "9a799a3661c16cd6ab4f6373ff6a04da95a9ab70d93b0a349b668466f4912fd7",
"checks": [
@@ -1043,8 +1043,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 840639,
- "artifactSha256": "c565cd212b0d7595e3b142b9959d4bfff3396a01cd470899a7be060e1a4aedcf",
+ "artifactBytes": 840872,
+ "artifactSha256": "908946adbc119a54a001b1c44dc7746636df301dfb8b8f87fe6f57f42f4c5939",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -1182,8 +1182,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 837958,
- "artifactSha256": "15c799fb0eef1a1fca4774d69832eacc4fcb62f88bede9e6bc0508237a3eabbf",
+ "artifactBytes": 838191,
+ "artifactSha256": "5d90a65e268f123a1a19ec08318bb64e5352ed62211f6805b62b36ac4711502d",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -1321,8 +1321,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 841890,
- "artifactSha256": "87dd2fc5a143a560d912eac2db8b445325dc2c664f6bb5b253500f97faf953c8",
+ "artifactBytes": 842123,
+ "artifactSha256": "4fbc89f8f13c05900207ceeb7708c6b9129e8988916d71615d9bcb6d960798b9",
"sourceBytes": 5618,
"sourceSha256": "91411404fb4828a3b7ea358f3a7b9877781c9e9dc9c04b42b6eb4a757281b59f",
"checks": [
@@ -1442,8 +1442,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 838653,
- "artifactSha256": "171fc59cee4b0b55d516da1957f99b2ecedac3e3b9b287358db42ae03faf333d",
+ "artifactBytes": 838886,
+ "artifactSha256": "93c219a959043bad4abf9901fec4429eb31b447ee051bbcb75ca808e47a8f1a1",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -1581,8 +1581,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 845888,
- "artifactSha256": "d32717a725a089d98e4b08aa5f2ad89549e16b6dea53f8493d189fbe699e30f9",
+ "artifactBytes": 846121,
+ "artifactSha256": "f6c6bedb86eec1791e0af20b33cfa88a9190b7ebb4d1460638a94838d5d8032d",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -1720,8 +1720,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 834967,
- "artifactSha256": "b6887cd22e16be826cb25c4e1a367fda4c69297cc59cefe271f90b133a0a0a49",
+ "artifactBytes": 835200,
+ "artifactSha256": "061318b52f2f4a274a9938f6987aea6991eac0a9666f598c537fb049c43f7cc6",
"sourceBytes": 4044,
"sourceSha256": "7c0ad72ee7affbd6c6e4758b7520d61ddd4508c917acf36beabcad3ee7ca3ba7",
"checks": [
@@ -1841,8 +1841,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 836509,
- "artifactSha256": "2c6cfe2bdfebf4eda0eb97b77e60c48e70b0b30e4b9257d86096fc5beea14ab3",
+ "artifactBytes": 836742,
+ "artifactSha256": "cd731531477518cdbaaf01640025828a449e777512ff106ca8ddf4a504c5d563",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -1980,8 +1980,8 @@ receipt 99 checks / 11 artifacts / deterministic hashes</pre>
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 839276,
- "artifactSha256": "678699af5b7a6e573f25cefc8a83fa240b18e60978693a30b52a73473a5656ad",
+ "artifactBytes": 839509,
+ "artifactSha256": "06ecdebbb365cdc54ae81ee99d4ff7ce98aa6944f6be3d42f66ce0cd5c8748a9",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
diff --git a/docs/gallery/artifacts/agent-run.lifecycle.html b/docs/gallery/artifacts/agent-run.lifecycle.html
index df09a2a8..cf45fa09 100644
--- a/docs/gallery/artifacts/agent-run.lifecycle.html
+++ b/docs/gallery/artifacts/agent-run.lifecycle.html
@@ -6389,9 +6389,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6411,17 +6414,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6433,9 +6436,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6450,7 +6453,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7020,7 +7023,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/agent-tool-call.workflow.html b/docs/gallery/artifacts/agent-tool-call.workflow.html
index 4396f65b..626a809a 100644
--- a/docs/gallery/artifacts/agent-tool-call.workflow.html
+++ b/docs/gallery/artifacts/agent-tool-call.workflow.html
@@ -6460,9 +6460,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6482,17 +6485,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6504,9 +6507,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6521,7 +6524,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7091,7 +7094,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/async-job-roundtrip.sequence.html b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
index a642ecfb..2aea0dde 100644
--- a/docs/gallery/artifacts/async-job-roundtrip.sequence.html
+++ b/docs/gallery/artifacts/async-job-roundtrip.sequence.html
@@ -6481,9 +6481,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6503,17 +6506,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6525,9 +6528,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6542,7 +6545,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7112,7 +7115,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/cache-miss.sequence.html b/docs/gallery/artifacts/cache-miss.sequence.html
index e67d6658..6b9116de 100644
--- a/docs/gallery/artifacts/cache-miss.sequence.html
+++ b/docs/gallery/artifacts/cache-miss.sequence.html
@@ -6469,9 +6469,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6491,17 +6494,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6513,9 +6516,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6530,7 +6533,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7100,7 +7103,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/deployment-release.lifecycle.html b/docs/gallery/artifacts/deployment-release.lifecycle.html
index 01f7d996..b7f70724 100644
--- a/docs/gallery/artifacts/deployment-release.lifecycle.html
+++ b/docs/gallery/artifacts/deployment-release.lifecycle.html
@@ -6415,9 +6415,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6437,17 +6440,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6459,9 +6462,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6476,7 +6479,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7046,7 +7049,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/event-stream.dataflow.html b/docs/gallery/artifacts/event-stream.dataflow.html
index 5bb36a88..c7ce163a 100644
--- a/docs/gallery/artifacts/event-stream.dataflow.html
+++ b/docs/gallery/artifacts/event-stream.dataflow.html
@@ -6493,9 +6493,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6515,17 +6518,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6537,9 +6540,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6554,7 +6557,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7124,7 +7127,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/incident-response.workflow.html b/docs/gallery/artifacts/incident-response.workflow.html
index fbd865cd..96ec573a 100644
--- a/docs/gallery/artifacts/incident-response.workflow.html
+++ b/docs/gallery/artifacts/incident-response.workflow.html
@@ -6420,9 +6420,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6442,17 +6445,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6464,9 +6467,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6481,7 +6484,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7051,7 +7054,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/product-analytics.dataflow.html b/docs/gallery/artifacts/product-analytics.dataflow.html
index 86f7d8ed..f9eccdd4 100644
--- a/docs/gallery/artifacts/product-analytics.dataflow.html
+++ b/docs/gallery/artifacts/product-analytics.dataflow.html
@@ -6454,9 +6454,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6476,17 +6479,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6498,9 +6501,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6515,7 +6518,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7085,7 +7088,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/production-deployment.architecture.html b/docs/gallery/artifacts/production-deployment.architecture.html
index ea7cd404..319fc86a 100644
--- a/docs/gallery/artifacts/production-deployment.architecture.html
+++ b/docs/gallery/artifacts/production-deployment.architecture.html
@@ -6497,9 +6497,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6519,17 +6522,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6541,9 +6544,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6558,7 +6561,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7128,7 +7131,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/release-delivery.workflow.html b/docs/gallery/artifacts/release-delivery.workflow.html
index cfa67f86..91b6bf45 100644
--- a/docs/gallery/artifacts/release-delivery.workflow.html
+++ b/docs/gallery/artifacts/release-delivery.workflow.html
@@ -6446,9 +6446,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6468,17 +6471,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6490,9 +6493,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6507,7 +6510,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7077,7 +7080,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/artifacts/web-app.architecture.html b/docs/gallery/artifacts/web-app.architecture.html
index 42097c2f..f5efa89b 100644
--- a/docs/gallery/artifacts/web-app.architecture.html
+++ b/docs/gallery/artifacts/web-app.architecture.html
@@ -6442,9 +6442,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6464,17 +6467,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6486,9 +6489,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6503,7 +6506,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7073,7 +7076,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/docs/gallery/manifest.json b/docs/gallery/manifest.json
index 6a9aaf35..c899adf2 100644
--- a/docs/gallery/manifest.json
+++ b/docs/gallery/manifest.json
@@ -27,8 +27,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 11,
- "artifactBytes": 844423,
- "artifactSha256": "9449f18562cc45956597384867db12492f55eb46cd3e3436da9fcf6249d6f319",
+ "artifactBytes": 844656,
+ "artifactSha256": "28c4eb28d352ecd6489e9c10eafc32323d2fd4100a474ebedc59bb809f0a2c19",
"sourceBytes": 5687,
"sourceSha256": "4d3f6c23de2ca7d306e05d0041a9506833bb5a164a2bddc2d1984cf4da3ee90c",
"checks": [
@@ -148,8 +148,8 @@
"engineeringProfile": "deployment-ownership",
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 847651,
- "artifactSha256": "050420ae94535512340610575d118cd903914b496450825c6455799748eb28c4",
+ "artifactBytes": 847884,
+ "artifactSha256": "13e57abb96b02a04aa39135d3ce4bc3098ac7c73125a59f988603041e7df3fc0",
"sourceBytes": 5476,
"sourceSha256": "ec484aa8576664fdb207b543fa49486b23273faccb7a5071e1a0becfb48c22eb",
"checks": [
@@ -274,8 +274,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 12,
- "artifactBytes": 839535,
- "artifactSha256": "7151915ebea4646bbdabdc3d06677984481909304ff9cabae13b8a08a7a8674b",
+ "artifactBytes": 839768,
+ "artifactSha256": "564d9b9365f2aaab77bedec77914d2b8c1155a3fdd69ceae2d3f60a763b2834b",
"sourceBytes": 4374,
"sourceSha256": "9a799a3661c16cd6ab4f6373ff6a04da95a9ab70d93b0a349b668466f4912fd7",
"checks": [
@@ -395,8 +395,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 840639,
- "artifactSha256": "c565cd212b0d7595e3b142b9959d4bfff3396a01cd470899a7be060e1a4aedcf",
+ "artifactBytes": 840872,
+ "artifactSha256": "908946adbc119a54a001b1c44dc7746636df301dfb8b8f87fe6f57f42f4c5939",
"sourceBytes": 5164,
"sourceSha256": "e5c880417eac1623923c3dd5461e0c78acd762e1621a28bd53fc14a84cad6a91",
"checks": [
@@ -534,8 +534,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 10,
- "artifactBytes": 837958,
- "artifactSha256": "15c799fb0eef1a1fca4774d69832eacc4fcb62f88bede9e6bc0508237a3eabbf",
+ "artifactBytes": 838191,
+ "artifactSha256": "5d90a65e268f123a1a19ec08318bb64e5352ed62211f6805b62b36ac4711502d",
"sourceBytes": 5375,
"sourceSha256": "5c760c82eee545dfb7da38a4e628059d7891af4cfbfc13c8a7009ea64f69aa1b",
"checks": [
@@ -673,8 +673,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 10,
- "artifactBytes": 841890,
- "artifactSha256": "87dd2fc5a143a560d912eac2db8b445325dc2c664f6bb5b253500f97faf953c8",
+ "artifactBytes": 842123,
+ "artifactSha256": "4fbc89f8f13c05900207ceeb7708c6b9129e8988916d71615d9bcb6d960798b9",
"sourceBytes": 5618,
"sourceSha256": "91411404fb4828a3b7ea358f3a7b9877781c9e9dc9c04b42b6eb4a757281b59f",
"checks": [
@@ -794,8 +794,8 @@
"engineeringProfile": null,
"nodeCount": 7,
"edgeCount": 14,
- "artifactBytes": 838653,
- "artifactSha256": "171fc59cee4b0b55d516da1957f99b2ecedac3e3b9b287358db42ae03faf333d",
+ "artifactBytes": 838886,
+ "artifactSha256": "93c219a959043bad4abf9901fec4429eb31b447ee051bbcb75ca808e47a8f1a1",
"sourceBytes": 4370,
"sourceSha256": "545f20920c89b69c2bb1f15508d5543fddbeb15cffba61e102206e04bd5a5cd9",
"checks": [
@@ -933,8 +933,8 @@
"engineeringProfile": null,
"nodeCount": 12,
"edgeCount": 12,
- "artifactBytes": 845888,
- "artifactSha256": "d32717a725a089d98e4b08aa5f2ad89549e16b6dea53f8493d189fbe699e30f9",
+ "artifactBytes": 846121,
+ "artifactSha256": "f6c6bedb86eec1791e0af20b33cfa88a9190b7ebb4d1460638a94838d5d8032d",
"sourceBytes": 5433,
"sourceSha256": "a92d6597ddbe164f395da32a7d4b33cfae08edd7d9600a6fb45a2058e5bbb43e",
"checks": [
@@ -1072,8 +1072,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 6,
- "artifactBytes": 834967,
- "artifactSha256": "b6887cd22e16be826cb25c4e1a367fda4c69297cc59cefe271f90b133a0a0a49",
+ "artifactBytes": 835200,
+ "artifactSha256": "061318b52f2f4a274a9938f6987aea6991eac0a9666f598c537fb049c43f7cc6",
"sourceBytes": 4044,
"sourceSha256": "7c0ad72ee7affbd6c6e4758b7520d61ddd4508c917acf36beabcad3ee7ca3ba7",
"checks": [
@@ -1193,8 +1193,8 @@
"engineeringProfile": null,
"nodeCount": 11,
"edgeCount": 6,
- "artifactBytes": 836509,
- "artifactSha256": "2c6cfe2bdfebf4eda0eb97b77e60c48e70b0b30e4b9257d86096fc5beea14ab3",
+ "artifactBytes": 836742,
+ "artifactSha256": "cd731531477518cdbaaf01640025828a449e777512ff106ca8ddf4a504c5d563",
"sourceBytes": 4274,
"sourceSha256": "735c2c5819266e6ea2a71775b6eefce98b53030ce90cb721dc8e1d022ce5be71",
"checks": [
@@ -1332,8 +1332,8 @@
"engineeringProfile": null,
"nodeCount": 10,
"edgeCount": 9,
- "artifactBytes": 839276,
- "artifactSha256": "678699af5b7a6e573f25cefc8a83fa240b18e60978693a30b52a73473a5656ad",
+ "artifactBytes": 839509,
+ "artifactSha256": "06ecdebbb365cdc54ae81ee99d4ff7ce98aa6944f6be3d42f66ce0cd5c8748a9",
"sourceBytes": 3793,
"sourceSha256": "483350f5297df682aba4e4a0fa491307ce3d3abd725ae4df07fab177490752cf",
"checks": [
diff --git a/examples/dataflow-product-analytics.html b/examples/dataflow-product-analytics.html
index 86f7d8ed..f9eccdd4 100644
--- a/examples/dataflow-product-analytics.html
+++ b/examples/dataflow-product-analytics.html
@@ -6454,9 +6454,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6476,17 +6479,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6498,9 +6501,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6515,7 +6518,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7085,7 +7088,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/examples/lifecycle-agent-run.html b/examples/lifecycle-agent-run.html
index df09a2a8..cf45fa09 100644
--- a/examples/lifecycle-agent-run.html
+++ b/examples/lifecycle-agent-run.html
@@ -6389,9 +6389,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6411,17 +6414,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6433,9 +6436,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6450,7 +6453,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7020,7 +7023,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/examples/sequence-cache-miss-request.html b/examples/sequence-cache-miss-request.html
index e67d6658..6b9116de 100644
--- a/examples/sequence-cache-miss-request.html
+++ b/examples/sequence-cache-miss-request.html
@@ -6469,9 +6469,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6491,17 +6494,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6513,9 +6516,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6530,7 +6533,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7100,7 +7103,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/examples/web-app-rendered.html b/examples/web-app-rendered.html
index 42097c2f..f5efa89b 100644
--- a/examples/web-app-rendered.html
+++ b/examples/web-app-rendered.html
@@ -6442,9 +6442,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6464,17 +6467,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6486,9 +6489,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6503,7 +6506,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7073,7 +7076,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/examples/web-app.html b/examples/web-app.html
index 42097c2f..f5efa89b 100644
--- a/examples/web-app.html
+++ b/examples/web-app.html
@@ -6442,9 +6442,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6464,17 +6467,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6486,9 +6489,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6503,7 +6506,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7073,7 +7076,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/examples/workflow-agent-tool-call-rendered.html b/examples/workflow-agent-tool-call-rendered.html
index 4396f65b..626a809a 100644
--- a/examples/workflow-agent-tool-call-rendered.html
+++ b/examples/workflow-agent-tool-call-rendered.html
@@ -6460,9 +6460,12 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -6482,17 +6485,17 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -6504,9 +6507,9 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -6521,7 +6524,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -7091,7 +7094,7 @@ OTHER DEALINGS IN THE FONT SOFTWARE.
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {
diff --git a/viewer/export.js b/viewer/export.js
index 2f273a91..accf1506 100644
--- a/viewer/export.js
+++ b/viewer/export.js
@@ -307,9 +307,12 @@
document.body.appendChild(probe);
try {
var c = getComputedStyle(probe);
- return varNames.map(function (n) {
- return n + ': ' + c.getPropertyValue(n).trim() + ';';
- }).join(' ');
+ return {
+ background: c.getPropertyValue('--bg').trim(),
+ vars: varNames.map(function (n) {
+ return n + ': ' + c.getPropertyValue(n).trim() + ';';
+ }).join(' ')
+ };
} finally {
document.body.removeChild(probe);
}
@@ -329,17 +332,17 @@
// prefers-color-scheme still render), light swaps in via media
// query, and svg[data-theme="..."] still lets downstream
// consumers force a specific theme.
- var darkVars = resolveVars('dark');
- var lightVars = resolveVars('light');
+ var darkTheme = resolveVars('dark');
+ var lightTheme = resolveVars('light');
style.textContent =
fontCss + "\n" +
"svg { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'DejaVu Sans Mono', 'Liberation Mono', 'Noto Sans Mono CJK SC', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', monospace; }\n" +
hostStyle + "\n" +
- ":root, svg { " + darkVars + " }\n" +
- "@media (prefers-color-scheme: light) { :root, svg { " + lightVars + " } }\n" +
- "svg[data-theme=\"light\"] { " + lightVars + " }\n" +
- "svg[data-theme=\"dark\"] { " + darkVars + " }\n" +
+ ":root, svg { " + darkTheme.vars + " }\n" +
+ "@media (prefers-color-scheme: light) { :root, svg { " + lightTheme.vars + " } }\n" +
+ "svg[data-theme=\"light\"] { " + lightTheme.vars + " }\n" +
+ "svg[data-theme=\"dark\"] { " + darkTheme.vars + " }\n" +
"rect.c-bg-rect { fill: var(--bg); }\n";
// Don't lock the serialized SVG to the viewer's current theme.
@@ -351,9 +354,9 @@
// Raster exports keep the viewer's current theme. Explicit SVG
// exports instead select their own stable light/dark source.
var lockedTheme = requestedTheme || document.documentElement.getAttribute('data-theme') || 'dark';
- var themeHost = document.querySelector('[data-theme="' + lockedTheme + '"]') || document.documentElement;
- var computed = getComputedStyle(themeHost);
- var vars = varNames.map(function (n) {
+ var resolvedTheme = requestedTheme && resolveVars(lockedTheme);
+ var computed = getComputedStyle(document.documentElement);
+ var vars = resolvedTheme ? resolvedTheme.vars : varNames.map(function (n) {
return n + ': ' + computed.getPropertyValue(n).trim() + ';';
}).join(' ');
@@ -368,7 +371,7 @@
":root, svg { " + vars + " }\n";
if (requestedTheme) clone.setAttribute('data-theme', lockedTheme);
- bgRect.setAttribute('fill', computed.getPropertyValue('--bg').trim() || '#ffffff');
+ bgRect.setAttribute('fill', (resolvedTheme ? resolvedTheme.background : computed.getPropertyValue('--bg').trim()) || '#ffffff');
}
if (opts.routeSnapshot) {
@@ -938,7 +941,7 @@
// WebP encoding (older Safari), so detect explicitly.
function supports(format) {
if (format === 'share-card') return true;
- if (format === 'svg' || format === 'png') return true;
+ if (format === 'svg' || format === 'svg-light' || format === 'svg-dark' || format === 'png') return true;
if (format === 'webm') return canRecordMotion();
var mime = format === 'jpeg' ? 'image/jpeg' : 'image/webp';
try {