Skip to content

Commit abff5aa

Browse files
authored
fix(screenshots): force light theme, hide theme switcher (#4803)
* fix(screenshots): force light theme, hide theme switcher * chore: update screenshots
1 parent 0ed6938 commit abff5aa

File tree

262 files changed

+6
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

262 files changed

+6
-1
lines changed

packages/documentation-framework/scripts/writeScreenshots.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ sharp.cache(false);
1010

1111
async function writeScreenshot({ page, data: { url, urlPrefix } }) {
1212
await page.goto(url);
13-
await page.addStyleTag({content: '*,*::before,*::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;transition-duration:0s !important;transition-delay:0s !important;}'}); // disable animations/transitions so they don't interfere with screenshot tool
13+
// set light theme
14+
await page.emulateMediaFeatures([{ name: 'prefers-color-scheme', value: 'light' }]);
15+
// disable any transitions/animations
16+
await page.addStyleTag({content: '*,*::before,*::after{animation-delay:-1ms !important;animation-duration:1ms !important;animation-iteration-count:1 !important;transition-duration:0s !important;transition-delay:0s !important;}'});
17+
// hide theme switcher
18+
await page.addStyleTag({content: '.ws-full-page-utils { display: none !important; }'});
1419
await page.waitForSelector('.pf-v6-u-h-100');
1520
const outfile = path.join(
1621
screenshotBase,
-1.13 KB
-511 Bytes
-2.11 KB
-1.69 KB
-2.28 KB
-588 Bytes
-853 Bytes
5.13 KB
52.2 KB

0 commit comments

Comments
 (0)