mrclay / minify

Combines. minifies, and serves CSS or Javascript files
BSD 3-Clause "New" or "Revised" License
3.01k stars 473 forks source link

CSS custom properties are prepended with path #680

Open mauskin opened 3 years ago

mauskin commented 3 years ago

When url uses custom property it is prepended with a path so that this

background-image: url(var(--nice-view));

turns to

background-image: url(/path/to/css/var(--nice-view));

Is there a way to avoid this?

mauskin commented 3 years ago

Of course there’s a way. Just include url in your custom property so that instead of this

background-image: url(var(--nice-view));

you would write this

background-image: var(--nice-view);

And the property has to be defined like this: --nice-view: url(path/to/img.jpg);.