Skip to content

Allow setting preferred Vitest UI color scheme for Playwright #32469

@csvn

Description

@csvn

Command

test

Description

The Vitest UI has an option to toggle Light/Dark mode on or off. But when using @vitest/browser-playwright then the users preference is always set to light, and does not respect OS preference. The big drawback here is that even if the UI button is toggled, it's reset the next time tests are started since it's not preserved. There's a way to configure this, but it requires a vitest.config.js: vitest-dev/vitest#8947 (comment)

Describe the solution you'd like

It would be great if Angular CLI could either allow configuring this default value or set it so it uses OS preference, when using the "test.options.browser" field.

  • Angular CLI configures contextOptions.colorScheme to be null and thus prefers-color-scheme to be OS default
  • An angular.json option to configure a new uiTheme to select light/dark/auto values

Describe alternatives you've considered

Using a custom vitest.config.js configuration to manually set playwright() plugin options. But it feels a bit overkill for this A11y feature.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions