Behaviour SwRS-MDOKFSTUDIO-THEME-034
A host colour that is set is used, an unset one keeps the fallback
When the host sets a colour the page uses, the extension SHALL paint the page with that colour, and when the host does not set it, the page SHALL keep the fallback colour written in its rule; the --vscode- variables are read through one token map and every token the page reads is in it.
Part of StRS-MDOKFSTUDIO-THEME-002, outside the paths drawn on its map.
Scenarios 5
The situations the tests check; open one to read it.
nominalToken map
Giventhe token name list
Whenthe VS Code mapping block is read
Thenit starts with `:root, body` and holds one declaration `--studio-{name}: var(--vscode-{name})` for each name of the token list (57 names at the time of writing, not asserted), with no duplicate name
boundaryVariable not set by the host
Givena host that does not set one of the mapped --vscode- variables
Whena rule reads var(--studio-{name}, {fallback})
Thenthe token is unset, so the fallback written in the rule applies exactly as it did for the host variable
nominalStylesheet without the map
Giventhe accessibility and theme stylesheets
Whenthe token map block is removed
Thenno text --vscode- remains
nominalMap first
Giventhe accessibility stylesheet
Whenits start is read
Thenit starts with the token map
boundaryEvery token read is in the map
Giventhe tokens read by the page, as in the table
Whenthe names are checked against the token list
Theneach name is in the list
| Input | Outcome |
|---|---|
| Every --studio-{name} used by the accessibility and theme stylesheets | Each name is in the token list |
| The four tokens read by the Mermaid theme (textCodeBlock-background, editor-foreground, textBlockQuote-background, editor-background) | Each name is in the token list |