Skip to content

feat: support emulating additional CSS media features - #2929

Draft
mathiasbynens wants to merge 1 commit into
mainfrom
emulation-additions
Draft

mathiasbynens wants to merge 1 commit into
mainfrom
emulation-additions

Conversation

@mathiasbynens

Copy link
Copy Markdown
Member

This patch adds support for:

  • forced-colors
  • prefers-contrast
  • prefers-reduced-motion

Since Puppeteer’s page.emulateMediaFeatures doesn’t currently support forced-colors and prefers-contrast, this patch uses a single CDP call for prefers-color-scheme and the three new media features. (All four have to go in that one call, because each call replaces any media features set before.)

Longer-term we might want to support the additional media features in Puppeteer and then use that here.

@mathiasbynens

Copy link
Copy Markdown
Member Author

Longer-term we might want to support the additional media features in Puppeteer and then use that here.

Note: puppeteer/puppeteer#15495 adds forced-colors, prefers-contrast, and prefers-reduced-motion support to Puppeteer’s page.emulateMediaFeatures. Once it’s part of a release, we can use it in a CD4A patch (or update this patch).

This patch adds support for:

- `forced-colors`
- `prefers-contrast`
- `prefers-reduced-motion`
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