Markdown OKF-Schema Studio

Behaviour SwRS-MDOKFSTUDIO-THEME-025

Dark, White and Cream paint the whole page the same on any VS Code theme

When a forced theme mode (Dark, White or Cream) is shown, the extension SHALL paint the page, the floating toolbar and its pressed button, the sticky heading band and the note panels from the palette of that mode alone, so that the White mode paints a white page with the dark foreground text, light panels and a light colour scheme, and every forced mode looks the same on a dark and on a light VS Code theme.

Step 2 of path 1 in StRS-MDOKFSTUDIO-THEME-002: from “A theme mode is active” to “The whole page is painted in the colours of the mode”.

Scenarios 8

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

nominalWhite on a dark host
Giventhe handbook document forced to White on a dark VS Code theme in a 900 px pane (visual scenario theme-zoom/v01), and the frontmatter fixture forced to White on a dark host (visual scenario theme-zoom/v07)
Whenthe preview is rendered
Thenthe body background is rgb(255, 255, 255), the page text and the text of the first admonition are rgb(31, 31, 31) and the admonition panel is light (every colour channel at least 180); with the properties table the page background is white, the text is the dark foreground and the first admonition panel is light, as in the handbook
nominalDark on a light host and on a dark host
Giventhe handbook forced to Dark while the VS Code theme stays light in a 900 px pane (visual scenario theme-zoom/v08), and Dark mode on a dark VS Code theme (real-input capture theme-zoom/r03)
Whenthe preview is rendered
Thenon the light host the html attribute data-sphinx-preview-theme-mode is dark, the body background is rgb(30, 30, 30), the text is rgb(212, 212, 212), the colour scheme is dark, the first admonition is drawn on a dark panel and the h1 heading is readable on it; on the dark host the page is rgb(30, 30, 30) and the toolbar rgb(37, 37, 38), the same as on a light host
nominalCream on a dark host
Giventhe handbook forced to Cream on a dark VS Code theme in a 900 px pane (visual scenarios theme-zoom/v02 to v06, also with the admonition gallery, code and tables, the properties fixture and an open paragraph editor)
Whenthe preview is rendered
Thenthe body background is rgb(245, 241, 232), the page and note text rgb(43, 42, 39), the links and inline code rgb(161, 78, 50), the fenced block background rgb(237, 230, 218) and the colour scheme is light

The edition palette's mode selector uses the forced palette's widget background, page foreground and widget border rather than the host dropdown colours. In Cream these are rgb(251, 248, 241), rgb(43, 42, 39) and rgb(214, 205, 189), even when the host dropdown is dark. Dark and White apply the same rule with their own palette; Current mode continues to follow the host.

boundaryWarm paper rule
Giventhe Cream colour variables of the stylesheet
Whenthe editor background is read
Thenits red channel is above 0xE8 and red is greater than green, which is greater than blue
nominalToolbar colours of the forced modes
Givena forced mode shown on a VS Code theme as in the table
Whenthe toolbar is drawn
Thenits colours are those of the mode and not the VS Code ones
InputOutcome
White mode on a dark VS Code themeToolbar background rgb(243, 243, 243), text rgb(51, 51, 51)
Dark mode on a light VS Code themeToolbar background rgb(37, 37, 38), pressed button rgb(14, 99, 156)
Dark mode on a dark VS Code theme (capture theme-zoom/r03)Toolbar background rgb(37, 37, 38)
nominalSticky heading band and borders
Givena forced mode shown, the sticky heading band drawn, and the top, right and bottom border colours of the toolbar and of every note panel read
Whenthe mode is as in the table
Thenthe band and the borders take the colours in the table, and they are the same on the default dark and the default light VS Code themes
InputOutcome
Sticky heading band, White mode on a dark hostBackground is the white page colour, text is the dark page text
Sticky heading band, Dark mode on a light hostBackground is rgb(30, 30, 30)
Toolbar and note panel borders, Darkrgb(69, 69, 69)
Toolbar and note panel borders, Whitergb(200, 200, 200)
Toolbar and note panel borders, Creamrgb(214, 205, 189)
boundaryThe same colours on both hosts
GivenDark, White and Cream in turn on the default dark and the default light VS Code themes, and a host that maps the tokens to its own palette
Whenthe page and toolbar colours are read
Thenon both hosts they equal the colours of the scenarios above, and the mode colours do not depend on the host mapping
boundaryThe three mode blocks of the stylesheet
Giventhe Dark, White and Cream mode blocks of the stylesheet (selectors `html[data-sphinx-preview-theme-mode="{mode}"], ... body`)
Whenthe variable names and the values of each block are read
Thenthe lists of Dark and White equal the list of Cream, so no mode leaves a host colour in place, the toolbar variables included; every variable White overrides has a Cream value and Cream is light; each block declares --studio-editor-background as a six digit hex colour and contains no --vscode-

Implemented in 1

Tested by 8