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");
}
Written by Sven Read
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Css
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#