Skip to content

fix(palette): teach the canonical SVG var() form via style=#172

Merged
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync
Jun 16, 2026
Merged

fix(palette): teach the canonical SVG var() form via style=#172
inkeep-oss-sync[bot] merged 1 commit into
mainfrom
copybara/sync

Conversation

@inkeep-oss-sync

Copy link
Copy Markdown
Contributor

No description provided.

Two surfaces taught the invalid `<circle fill="var(--chart-1)">`
shape:
  1. The `custom-svg` starter snippet used `fill="var(...)"` /
     `stroke="var(...)"` directly. Agents extrapolated from this
     example into their own SVG and shipped charts that silently fell
     back to black in Safari / older Chromium (CSS `var()` is not a
     valid SVG `<paint>` per the W3C spec — Chromium 113+ tolerates
     it as a non-standard extension; nothing else does).
  2. The `palette` MCP tool's `tokens` description told agents to
     reference theme tokens "as `var(--chart-1)`, `var(--foreground)`,
     … inside an `html preview` embed" with no caveat that the SVG
     route specifically must go through `style="..."`.

Both fixed:
  - Starter snippet now uses `style="fill: none; stroke: var(--chart-1)"`
    — works in every browser, teaches the canonical W3C form.
  - `palette` tool description appends a hard-stop rule for SVG, with
    the working / broken pair so agents can't miss it.

Regression test in `preview-embed-starters.test.ts` greps every
starter's `<svg>` subtree for `var(...)` inside any SVG paint-
accepting presentation attribute (`fill` / `stroke` / `color` /
`stop-color` / `flood-color` / `lighting-color`); future starters
that ship the wrong shape fail with the fix locus + canonical form
in the failure message.

Closes PRD-6760.

GitOrigin-RevId: 269cb5c565fc1f6e035528bee6138d34cf59d301

@inkeep-internal-ci inkeep-internal-ci Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automated approval from agents-private public-mirror-sync (run: https://github.com/inkeep/agents-private/actions/runs/27654725561). Source of truth is the monorepo; direct edits on inkeep/open-knowledge are overwritten on next sync.

@inkeep-oss-sync inkeep-oss-sync Bot merged commit 45c2f64 into main Jun 16, 2026
@inkeep-oss-sync inkeep-oss-sync Bot deleted the copybara/sync branch June 16, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant