webp-in-css icon indicating copy to clipboard operation
webp-in-css copied to clipboard

question: does this plugin assume webp image exist?

Open ahmadalfy opened this issue 6 years ago • 9 comments

Hello, does this plugin check if a webp version of the image exist or not? It's more convenient than creating the declarations automatically. There is another plugin that checks for the existence of the image (postcss-retina-bg-img).

I would love to add that feature if it doesn't exist.

ahmadalfy avatar May 29 '19 02:05 ahmadalfy

It doesn't check it, but we can add it.

What we will do in this case? Show error?

ai avatar May 29 '19 06:05 ai

It can just show a warning or an info that a webp version does not exist and simply ignore the declaration. The benefit of that is that you shift the purpose of the package to be solely adding webp only if it exist. The conversion shouldn't bother us and left to the author. It can manually generate it, generate it using a gulp plugin or whatever the author wants.

ahmadalfy avatar May 29 '19 09:05 ahmadalfy

Sure. Here is PostCSS for warnings http://api.postcss.org/Node.html#warn

I will wait for PR.

ai avatar May 29 '19 09:05 ai

Awesome, will start working on it.

ahmadalfy avatar May 29 '19 09:05 ahmadalfy

Let’s keep issue open until we will fix the problem (just as ToDo note)

ai avatar May 29 '19 09:05 ai

Is this still relevant? I'd like to work on it if it's still needed

AhmedFat7y avatar May 03 '20 19:05 AhmedFat7y

@AhmedFat7y yeap, we still need to fix it

ai avatar May 03 '20 19:05 ai

@AhmedFat7y It's yours, my apologies I didn't have time for it

ahmadalfy avatar May 03 '20 20:05 ahmadalfy

This is still not implemented, can I try?

I'm thinking of taking the value from inside url() at the background, background-image, etc. I don’t know yet how to determine the existence of pictures, maybe it has already been implemented somewhere? I am trying to find a similar problem

boldevelop avatar Dec 22 '20 05:12 boldevelop