-
Notifications
You must be signed in to change notification settings - Fork 2
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
Keep the image-set() syntax around for browsers that support it #14
Comments
+1, if all non-supporting browsers just ignore the background-image with image-set and don't show a blank background though. |
Thanks for report!
If there is any advantages of saving |
Closing for lack of action. |
just recognized that this polyfill replaces expected behaviour for me is input: .foo {
background-image: image-set('path/to/image.png' 1x, 'path/to/image@2x.png' 2x);
} output: @media (min-resolution: 2dppx) {
.foo {
background-image: url('path/to/image@2x.png');
}
}
.foo {
background-image: url('path/to/image.png');
}
@supports (background-image: image-set('path/to/image.png' 1x, 'path/to/image@2x.png' 2x)) {
.foo {
background-image: image-set('path/to/image.png' 1x, 'path/to/image@2x.png' 2x);
}
} last part is missing for now: if browser can do it, it must do it |
Media queries are all very well for browsers that don’t support
image-set()
, but it’d be nice to leave theimage-set()
function in there so that browsers that do support it can use it—because they will handle transitions between queries better (such as keeping the old image around until the new one is loaded, which I’m guessing they won’t do for media-query-based image source changes).I haven’t thought too deeply about this, but I don’t think
@supports
will need to be used—just create a new rule after the media queries which will overrule them. But doing this properly will entail decomposing shorthand syntaxes, sobackground: image-set(…)
becomesbackground-image: image-set(…)
, lest other properties be accidentally reset.I expect this:
To compile to roughly this:
The text was updated successfully, but these errors were encountered: