Double url with LESS css

Lonioptioxeri

New Member
I have a simple LESS stylesheet for retina background images, but what ends up happening is it prepends my domain name to the url and fails to display the image.Ex: it will change the url to \[code\]http://mydomain.com/'_img/[email protected]'\[/code\], and then it doesn't display because it has the ' in there. How can I prevent it from doing such?\[code\].at2x(@path, @w: auto, @h: auto) { background-image: url(@path); @at2x_path: ~`"@{path}".split('.').slice(0, "@{path}".split('.').length - 1).join(".") + "@2x" + "." + "@{path}".split('.')["@{path}".split('.').length - 1]`; @media all and (-webkit-min-device-pixel-ratio : 1.5) { background-image: url("at2x_path); background-size: @w @h; }}html { .at2x('_img/background.jpg', 1440px, 900px);}\[/code\]
 
Back
Top