Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Browser Mode, css varaibles of browser ui confilcts with postcss-variables-prefixer #6559

Closed
6 tasks done
rikisamurai opened this issue Sep 24, 2024 · 0 comments · Fixed by #6564
Closed
6 tasks done
Labels
feat: browser Issues and PRs related to the browser runner p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@rikisamurai
Copy link

rikisamurai commented Sep 24, 2024

Describe the bug

In my project, I used CSS variables and added prefixes to all of them using postcss-variables-prefixer. However, when running in Vitest's browser mode, this caused the original CSS variables for Vitest's UI to also get prefixed, leading to some UI display issues.
image

But if not browser mode, vitest ui works well.

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-t5c8dy?file=vite.config.ts

  1. npm test
  2. open devtool and inspect elements
  3. you will see --myprefixun-rotate instead of --un-rotate

But if use vitest ui

  1. add headless: true in vitest.workspace.ts
  2. npm run test:ui
  3. you will see --un-rotate

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.20.3 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.2.3 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @vitejs/plugin-react: ^4.3.1 => 4.3.1 
    @vitest/browser: ^2.1.1 => 2.1.1 
    @vitest/ui: latest => 2.1.1 
    vite: latest => 5.4.7 
    vitest: latest => 2.1.1

Used Package Manager

npm

Validations

@hi-ogawa hi-ogawa added feat: browser Issues and PRs related to the browser runner p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Sep 25, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Oct 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: browser Issues and PRs related to the browser runner p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants