-
Notifications
You must be signed in to change notification settings - Fork 244
Closed
Description
When using a background-image: image-set(...) the recommendation is to have a fallback background-image: url(...), however that fallback is currently removed by parcel-css.
This is broken out from #109 (comment)
Expected:
.example {
background-image: url("background.png");
background-image: image-set(
url("background.avif") type("image/avif"),
url("background.png") type("image/png")
);
}To become:
.example {
background-image: url("background.png");
background-image: -webkit-image-set(
url("background.avif") type("image/avif"),
url("background.png") type("image/png")
);
background-image: image-set(
url("background.avif") type("image/avif"),
url("background.png") type("image/png")
);
}But became:
.example {
/* Notice the missing background-image: url here */
background-image: -webkit-image-set(
url("background.avif") type("image/avif"),
url("background.png") type("image/png")
);
background-image: image-set(
url("background.avif") type("image/avif"),
url("background.png") type("image/png")
);
}If you look at https://github.com/csstools/postcss-plugins/tree/main/plugins/postcss-image-set-function you can take this a step further by generating @media queries to try to emulate the switching for now supportive browsers as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels