playwright
playwright copied to clipboard
[Feature]: A option for `colorScheme` to follow the OS preference
🚀 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.