vitest-dev / vitest

Next generation testing framework powered by Vite.
https://vitest.dev
MIT License
12.66k stars 1.13k forks source link

Project name colours are not accessible #6338

Open mikeybinns opened 1 month ago

mikeybinns commented 1 month ago

Describe the bug

When running vitest UI on a Vitest Workspace, some of the workspace names are in a colour that is very hard to look at / read.

I can see the colours are basically defined here: https://github.com/vitest-dev/vitest/blob/85fb94a3081558b01f47bd763ccdaeb5df1b98cb/packages/ui/client/utils/task.ts#L28

In particular, blue is hard to read on dark mode, and yellow is hard to read on light mode.

All colours used should be checked against an accessibility colour checker to ensure their contrast is high enough, and this likely means having a different colour set for light mode and dark mode, as it's hard to have a single colour which works for both and also looks good.

Here are some screenshots: image image

Reproduction

To reproduce, start with the Workspace vitest example: https://github.com/vitest-dev/vitest/tree/main/examples/workspace Then rename one of the package folders to cli (this won't be the only way to force it to be blue, just one I know works) Run UI tests and set your theme in vitest UI to dark mode See result: image

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M1
    Memory: 201.28 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.nvm/versions/node/v20.15.0/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v20.15.0/bin/npm
  Browsers:
    Chrome: 127.0.6533.100
    Safari: 17.5
  npmPackages:
    @vitejs/plugin-react: ^4.2.1 => 4.3.1 
    @vitest/ui: latest => 2.0.5 
    vite: latest => 5.4.0 
    vitest: latest => 2.0.5

Used Package Manager

npm

Validations

AriPerkkio commented 1 month ago

There's related PR open that likely fixes this: https://github.com/vitest-dev/vitest/pull/6329