url
not handled when mixed with image-set in css multiple backgrounds
#18859
Labels
url
not handled when mixed with image-set in css multiple backgrounds
#18859
Describe the bug
All
url
backgrounds are ignored inbackground-image
when there isimage-set
present among multiple backgrounds.By ignored I mean vite doesn't handle them, leaving the url as it was as opposed to either embeding the image or updating the url with appropriate path for dev or production. This happens in simple css templates and with sass. I haven't tested more cases.
Reproduction
https://stackblitz.com/edit/vitejs-vite-a7wff4?file=src%2Fstyle.css
Steps to reproduce
$ pnpm create vite -t vanilla vite-css-bug $ cd vite-css-bug/ $ pnpm install
./src/style.css
:background-image
sources both eitherimage-set
orurl
If you
pnpm run build
and check the dist .css file, you'll most likely find the image-set svg url inlined, while the non image-set url is left as is and the svg file is not copied to the dist directory.vite-css-bug.tar.gz
System Info
System: OS: Linux 6.11 Arch Linux CPU: (12) x64 AMD Ryzen 5 5600U with Radeon Graphics Memory: 7.89 GB / 30.67 GB Container: Yes Shell: 5.2.37 - /usr/bin/bash Binaries: Node: 22.10.0 - /usr/bin/node npm: 10.9.0 - /usr/bin/npm pnpm: 9.12.2 - /usr/bin/pnpm npmPackages: vite: ^6.0.1 => 6.0.2
Used Package Manager
pnpm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: