playwright icon indicating copy to clipboard operation
playwright copied to clipboard

[Feature]: A option for `colorScheme` to follow the OS preference

Open silverwind opened this issue 1 year ago • 0 comments

🚀 Feature Request

The colorScheme setting should provide a option to have it follow the current OS setting, e.g. emulate dark when OS prefers dark, and light when OS prefers light.

Example

Add a new colorScheme: "auto" option which when set, emulates the current OS color scheme preference.

Motivation

This is how it works in regular browsers, so playwright should offer it optionally. The default should stay at light to retain stable tests.

In my testing with OS set to dark, neither 'no-preference' nor null have any effect and it stays in light. Maybe null is meant to provide the OS behaviour, not sure.

silverwind avatar May 08 '24 09:05 silverwind