bug: CSS unit being removed during build process when value is 0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 57/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- css, typescript, vite
- Domain
- build-system, frontend
Research direction
Start with the linked reproduction and compare how yarn dev and yarn build process the global CSS, focusing on the build pipeline’s CSS optimization step. Identify which stage removes the unit from 0px in border-image-outset, then add a regression case for the reported keyframe and verify the built CSS preserves the intended behavior.
Written by the indexing model from the issue text.
Description
Describe the bug
I have this code in a global CSS file:
@keyframes donateBorder {
from {
border-image-outset: 0 200px;
}
to {
border-image-outset: 0 0px;
}
}
in a dev server, this works without issue; however, once built, this becomes:
@keyframes donateBorder {
from {
border-image-outset: 0 200px;
}
to {
border-image-outset: 0 0;
}
}
...which doesn't work, because the unit is not specified.
Reproduction
https://github.com/rexogamer/vite-css-repro
Steps to reproduce
yarn && yarn dev- inspect the styles in the browser and scroll down to the keyframe
- observe that the units are specified correctly
yarn build && yarn preview- inspect the styles in the browser
- observe that the units are dropped
System Info
System:
OS: Linux 7.0 Ubuntu 26.04.1 LTS 26.04.1 LTS (Resolute Raccoon)
CPU: (8) x64 Intel(R) Core(TM) Ultra 7 256V
Memory: 4.53 GB / 14.47 GB
Container: Yes
Shell: 5.3.9 - /bin/bash
Binaries:
Node: 24.22.1 - /home/rexo/.nvm/versions/node/v24.22.1/bin/node
Yarn: 1.22.22 - /home/rexo/.nvm/versions/node/v24.22.1/bin/yarn
npm: 11.19.1 - /home/rexo/.nvm/versions/node/v24.22.1/bin/npm
pnpm: 12.16.1 - /home/rexo/.nvm/versions/node/v24.22.1/bin/pnpm
Deno: 2.9.5 - /home/rexo/.deno/bin/deno
Browsers:
Chromium: 158.0.8106.0
npmPackages:
vite: ^8.3.5 => 8.3.5
Used Package Manager
yarn
Logs
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- Dominant language
- TypeScript
- Stars
- 84k
- Forks
- 9.2k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 103
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vitejs/vite
-
Export the default server.fs.deny patternsPossibly taken @rvitaliy claimed this 19 days ago. Openpending triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vitejs/vite#24015 · 1 reaction ·
Maintainers usually reply within 1 day
-
normalizePath removes the Windows device namespace prefixPossibly taken @sep2 claimed this 23 days ago. Openp2-edge-case
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vitejs/vite#23986 · 1 comment ·
Maintainers usually reply within 1 day
-
Build fails with EISDIR when a `<link>` href is only a query stringPossibly taken @bhumin18 claimed this 32 days ago. Openfeat: html p2-edge-case
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
vitejs/vite#23807 · 1 comment ·
Maintainers usually reply within 1 day
-
Add a "copy error" button to the dev server error overlayPossibly taken @RajX-dev claimed this 131 days ago. Openp2-to-be-discussed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
vitejs/vite#22980 · 1 reaction ·
Maintainers usually reply within 1 day
-
Disconnect HMR WebSocket on pagehide for BFCache compatibilityMay be free again A pull request for this issue was closed without being merged. Openpending triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vitejs/vite#22361 · 5 comments · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
knaw-huc/textannoviz#742 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
cloudflare/realtimekit-ui#219 ·
Maintainers usually reply within 1 day
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
tui: Mermaid renderer displays <b>/<strong> tags literally and ignores \n line breaksPossibly taken @argszero claimed this today. Openarea/tui platform/wsl status/repro-simulated type/bug version/v2
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
anomalyco/opencode#66773 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
mermaid-js/mermaid-v13#1370 ·
Maintainers usually reply within 1 day