-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
fix(css): var in image-set #7921
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
Changes from all commits
174ea11
86522c7
20b81b0
d8b4a7a
4951e7d
8e1d6ae
468b3cd
6a4b9c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -26,6 +26,29 @@ | |||||||||||||||
background-size: 10px; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.css-image-set-with-var { | ||||||||||||||||
--bg-img: url('../nested/asset.png'); | ||||||||||||||||
background-image: -webkit-image-set(var(--bg-img) 1x, var(--bg-img) 2x); | ||||||||||||||||
background-size: 10px; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.css-image-set-mix-url-var { | ||||||||||||||||
--bg-img: url('../nested/asset.png'); | ||||||||||||||||
background-image: -webkit-image-set( | ||||||||||||||||
var(--bg-img) 1x, | ||||||||||||||||
url('../nested/asset.png') 2x | ||||||||||||||||
); | ||||||||||||||||
background-size: 10px; | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
.css-image-set-multiple-descriptor { | ||||||||||||||||
background-image: -webkit-image-set( | ||||||||||||||||
'../nested/asset.png' type('image/png') 1x, | ||||||||||||||||
'../nested/asset.png' type('image/png') 2x | ||||||||||||||||
); | ||||||||||||||||
background-size: 10px; | ||||||||||||||||
} | ||||||||||||||||
Comment on lines
+44
to
+50
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs to test inline CSS in HTML because it doesn't have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you share a failing example to add to the PR? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. vite/packages/vite/src/node/plugins/html.ts Lines 359 to 365 in 8e1d6ae
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! It is working though, are we good then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because I no add the assertion. 😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @poyoho gotcha. Should the fix for this case be part of this PR, though? This wasn't working before even without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I think this issue had two solutions. one is to remove the judge. other is add the judge. remove this judge may be better. But anyway it is also not part of this PR. (it seems to part of html instead of css). |
||||||||||||||||
|
||||||||||||||||
.css-url-public { | ||||||||||||||||
background: url('/icon.png'); | ||||||||||||||||
background-size: 10px; | ||||||||||||||||
|
Uh oh!
There was an error while loading. Please reload this page.