leafo/lessphp — Issue #159: Use a parameter for background-image in mixins
Author: Giakie
Created: 2011-12-12 09:07:26+00:00
State: open

Hi, I found this issue: you can't use directly a mixin parameter in a background image; first you have to create another variable and the you can use the new variable as the image url.

For example:

.sprite(@image_name; width:100px; ){
background: transparent url(../images/{@image_name}) no-repeat top left;
}

Is not working

Use this instead

.sprite(@image_name; width:100px; ){
@image: @image_name;
background: transparent url(../images/{@image}) no-repeat top left;
}