dark-mode-screenshot
is a Puppeteer script to take screenshots of both the light and dark mode versions of a website.
$ npx dark-mode-screenshot --url https://googlechromelabs.github.io/dark-mode-toggle/demo/index.html --output screenshot --fullPage
Works in somewhat odd way first requiring the OS to have dark mode enabled (?), and then launch Chromium:
- Once with
prefers-color-scheme
disabled (using--disable-blink-features=MediaQueryPrefersColorScheme
) - Once with Dark Mode force enabled (using
--force-dark-mode
)
dark-mode-screenshot
(GitHub) →
❓ New to Dark Mode? No worries, this post on CSS Color Scheme Queries has got you covered.