Make the light screenshot actually light
The light inbox screenshot in the README was not light, and had not been since it was first taken -- the pair showed the dark theme twice. The app was never at fault: update() calls applyTheme() synchronously and the CSS flips --bg to #f6f8fa as it should. The capture was. Swapping the theme under setDeviceMetricsOverride produces a mixed frame, the panes that re-rendered in the new theme and the rest of the chrome still in the old one, while the DOM and computed styles insist the whole page is light. Clicking the app's own toggle, setting the attribute, pinning it against applyTheme with a MutationObserver, installing that pin before the document loads, nudging the viewport and forcing a full reflow all left the frame mixed. Chrome launched at --window-size, with the emulation layer never touched, renders it correctly. That is docs/screenshots-light.mjs, and inbox-light.jpg is now genuinely light. assertTheme() stays: without it the script wrote a dark screenshot under a light caption and reported success, which is how this survived unnoticed. The header says which shots are taken elsewhere and why.
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 123 KiB After Width: | Height: | Size: 123 KiB |
Reference in New Issue
Block a user