Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-DIAG-126

A picture takes its colours from the preview theme

When the preview draws an svg picture, it SHALL define the variables surface, background, bg, border, text, foreground, fg, muted, accent, primary, red, green, blue and orange from the theme of the page (Cream, White, Dark or the VS Code theme), and SHALL give a variable of another name that has no fallback the text colour.

Step 2 of path 2 in StRS-MDOKFSTUDIO-DIAG-015: from “The drawing is in the page” to “The writer clicks the picture in edit mode”.

Scenarios 2

The situations the tests check; open one to read it.

nominalThe vocabulary follows the theme
Givena picture that fills shapes with var(--surface), var(--border), var(--accent), var(--green) and writes text in var(--text)
Whenthe page is in Cream, White, Dark or the VS Code theme
Theneach variable resolves to the matching --studio token of that theme (surface, background and bg to the code block background, border to the panel border, text, foreground and fg to the editor foreground, muted to the description foreground, accent and primary to the link colour, red, green, blue and orange to the chart colours)
boundaryA variable of another name
Givena picture that writes fill="var(--nope)" and fill="var(--nope, #123456)"
Whenthe preview renders it
Thenthe first fill takes the text colour and the second keeps its fallback
InputOutcome
a name of the vocabularythe theme colour
another name with a fallbackthe fallback
another name without a fallbackthe text colour

Implemented in 2

Tested by 3