You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While background-image: url(var(--bg-url)) is not valid and understood by browsers, the use of CSS vars in image-set is perfectly valid and working. See this codepen experiment (tested in Firefox, Chrome, Safari and Opera)1.
When using image-set, its content is processed via internal vite plugin vite-url-rewrite.
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 https://github.com/vuejs/core instead.
Note that, according to can I use, it is required to use the -webkit--prefixed version for browsers other than Firefox, and the use of direct string url value (no url()) is valid only in Firefox. ↩
The text was updated successfully, but these errors were encountered:
Describe the bug
While
background-image: url(var(--bg-url))
is not valid and understood by browsers, the use of CSS vars inimage-set
is perfectly valid and working. See this codepen experiment (tested in Firefox, Chrome, Safari and Opera)1.When using
image-set
, its content is processed via internal vite pluginvite-url-rewrite
.Input:
Output:
which is messed up and not understood by browsers.
This is, I guess, related to that commit (cc @HcySunYang) which incompletely handles CSS vars.
Reproduction
https://stackblitz.com/edit/vitejs-vite-zotkr1
System Info
Used Package Manager
yarn
Logs
No response
Validations
Footnotes
Note that, according to can I use, it is required to use the
-webkit-
-prefixed version for browsers other than Firefox, and the use of direct string url value (nourl()
) is valid only in Firefox. ↩The text was updated successfully, but these errors were encountered: