Skip to content

Setup for PG dark mode. - #3145

Open
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:pg-dark-mode-support
Open

Setup for PG dark mode.#3145
drgrice1 wants to merge 1 commit into
openwebwork:developfrom
drgrice1:pg-dark-mode-support

Conversation

@drgrice1

@drgrice1 drgrice1 commented Aug 19, 2026

Copy link
Copy Markdown
Member

Rework all of the problem rendering to support dark mode for PG.

This is straightforward for problems in sets. All of the code added to force light mode for problems just needed to be removed.

For the problem editor and all of the places that problems are rendered in an iframe via the render_rpc end point, a little work was needed to allow the parent to control the color scheme. The child (whose content is rendered via templates/RPCRenderFormats/default.html.ep) now sends a message to the parent to signal that it has loaded. This occurs at the beginning of the page load (it is important that this is earlier than the iframe load event or flickering will occur), and then the parent posts a message back to the child with the data { theme: 'mode' } where mode is either dark or light to set the mode of the iframe.

The problem editor is generally reworked so that everything is properly rendered in dark mode such as hardcopy theme xml and PG critic results.

@drgrice1
drgrice1 force-pushed the pg-dark-mode-support branch 2 times, most recently from 9a1cccd to b34b1cf Compare August 20, 2026 19:07
Rework all of the problem rendering to support dark mode for PG.

This is straightforward for problems in sets.  All of the code added to
force light mode for problems just needed to be removed.

For the problem editor and all of the places that problems are rendered
in an iframe via the `render_rpc` end point, a little work was needed to
allow the parent to control the color scheme. The child (whose content
is rendered via `templates/RPCRenderFormats/default.html.ep`) now sends
a message to the parent to signal that it has loaded. This occurs at the
beginning of the page load (it is important that this is earlier than
the iframe `load` event or flickering will occur), and then the parent
posts a message back to the child with the data `{ theme: 'mode' }`
where `mode` is either `dark` or `light` to set the mode of the iframe.

The problem editor is generally reworked so that everything is properly
rendered in dark mode such as hardcopy theme xml and PG critic results.
@drgrice1
drgrice1 force-pushed the pg-dark-mode-support branch from b34b1cf to 81311fc Compare August 20, 2026 22:13
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