Last Updated: May 31, 2021
·
1.696K
· starburst1977

Workaround LESS Webkit-Image-Set Bug

The LESS compiler spaces the 1x & 2x. This results in 1 x & 2 x in the CSS file. This leads to the browser skipping your Image Set. You can avoid this if you set the 1x & 2x in ~"1x" & ~"2x", as you can see in below:

.navigate {
background-image: -webkit-image-set(
url(bg-iconbar-button-navigate.png) ~"1x",
url(bg-iconbar-button-navigate-2x.png) ~"2x");
}

1 Response
Add your response

is doesnt work, its weird, it always add a space b4 "x", but it only does that for the charactor "x"!! frustrating

over 1 year ago ·